GetCustomPDFInformationKeys Method (GdPicturePDF)
In This Topic
Returns a string composed from the names of the custom information keys (custom metadata fields) of the currently loaded PDF document.
The included names of the custom information keys are separated with the specified separator.
Syntax
'Declaration
Public Function GetCustomPDFInformationKeys( _
ByVal As String _
) As String
public string GetCustomPDFInformationKeys(
string
)
public function GetCustomPDFInformationKeys(
: String
): String;
public function GetCustomPDFInformationKeys(
: String
) : String;
public: string* GetCustomPDFInformationKeys(
string*
)
public:
String^ GetCustomPDFInformationKeys(
String^
)
Parameters
- Separator
- The string used to separate all the names of the custom information keys in the resulting string.
Return Value
The names of the custom information keys separated with the specified separator as a string. The
GetStat method can be subsequently used to determine if this method has been successful.
Example
How to find out the names of the custom metadata fields if they are specified in the PDF document.
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
Dim keys As String = gdpicturePDF.GetCustomPDFInformationKeys(vbCrLf)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If keys.Equals("") Then
MessageBox.Show("Your PDF document does not contain any custom keys.", "Example: GetCustomPDFInformationKeys")
Else
MessageBox.Show("All custom keys are:" + vbCrLf + keys, "Example: GetCustomPDFInformationKeys")
End If
Else
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformationKeys")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: GetCustomPDFInformationKeys")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
string keys = gdpicturePDF.GetCustomPDFInformationKeys("\n");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (keys.Equals(""))
{
MessageBox.Show("Your PDF document does not contain any custom keys.", "Example: GetCustomPDFInformationKeys");
}
else
{
MessageBox.Show("All custom keys are:\n" + keys, "Example: GetCustomPDFInformationKeys");
}
}
else
{
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformationKeys");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: GetCustomPDFInformationKeys");
}
gdpicturePDF.Dispose();
Example
How to find out the names of the custom metadata fields if they are specified in the PDF document.
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
Dim keys As String = gdpicturePDF.GetCustomPDFInformationKeys(vbCrLf)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If keys.Equals("") Then
MessageBox.Show("Your PDF document does not contain any custom keys.", "Example: GetCustomPDFInformationKeys")
Else
MessageBox.Show("All custom keys are:" + vbCrLf + keys, "Example: GetCustomPDFInformationKeys")
End If
Else
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformationKeys")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: GetCustomPDFInformationKeys")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
string keys = gdpicturePDF.GetCustomPDFInformationKeys("\n");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (keys.Equals(""))
{
MessageBox.Show("Your PDF document does not contain any custom keys.", "Example: GetCustomPDFInformationKeys");
}
else
{
MessageBox.Show("All custom keys are:\n" + keys, "Example: GetCustomPDFInformationKeys");
}
}
else
{
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformationKeys");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: GetCustomPDFInformationKeys");
}
gdpicturePDF.Dispose();
See Also