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: GetCustomPDFInformation")
Else
MessageBox.Show("All custom keys are:" + vbCrLf + keys, "Example: GetCustomPDFInformation")
Dim value As String = ""
Dim outPut As String = ""
Dim keyTable As String() = Split(keys, vbCrLf)
For x As Integer = 0 To keyTable.Length - 1
value = gdpicturePDF.GetCustomPDFInformation(keyTable(x))
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
outPut = outPut + keyTable(x) + " = " + value + vbCrLf
Else
MessageBox.Show("The GetCustomPDFInformation() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformation")
End If
Next
MessageBox.Show("Custom keys and values are:" + vbCrLf + outPut, "Example: GetCustomPDFInformation")
End If
Else
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformation")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: GetCustomPDFInformation")
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: GetCustomPDFInformation");
}
else
{
MessageBox.Show("All custom keys are:\n" + keys, "Example: GetCustomPDFInformation");
string[] names = keys.Split('\n');
string value = "";
string output = "";
foreach (var name in names)
{
value = gdpicturePDF.GetCustomPDFInformation(name);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
output = output + name + " = " + value + "\n";
}
else
{
MessageBox.Show("The GetCustomPDFInformation() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformation");
}
}
MessageBox.Show("Custom keys and values are:\n" + output, "Example: GetCustomPDFInformation");
}
}
else
{
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: GetCustomPDFInformation");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: GetCustomPDFInformation");
}
gdpicturePDF.Dispose();