Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
Dim keys As String = gdpicturePDF.GetCustomPDFInformationKeys("~")
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If keys.Equals("") Then
MessageBox.Show("Your PDF document does not contain any custom keys.", "Example: DeleteCustomPDFInformation")
Else
If keys.Contains("gdpicture") Then
status = gdpicturePDF.DeleteCustomPDFInformation("gdpicture")
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SaveToFile("test_DeleteMetaData.pdf")
If status = GdPictureStatus.OK Then
MessageBox.Show("The example has been followed successfully and the file has been saved.", "Example: DeleteCustomPDFInformation")
Else
MessageBox.Show("The example has been followed successfully, but the file can't be saved. Status: " + status.ToString(), "Example: DeleteCustomPDFInformation")
End If
Else
MessageBox.Show("The DeleteCustomPDFInformation() method has failed with the status: " + status.ToString(), "Example: DeleteCustomPDFInformation")
End If
Else
MessageBox.Show("Your PDF document does not contain custom key gdpicture.", "Example: DeleteCustomPDFInformation")
End If
End If
Else
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: DeleteCustomPDFInformation")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: DeleteCustomPDFInformation")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
string keys = gdpicturePDF.GetCustomPDFInformationKeys("~");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (keys.Equals(""))
{
MessageBox.Show("Your PDF document does not contain any custom keys.", "Example: DeleteCustomPDFInformation");
}
else
{
if (keys.Contains("gdpicture"))
{
status = gdpicturePDF.DeleteCustomPDFInformation("gdpicture");
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SaveToFile("test_DeleteMetaData.pdf");
if (status == GdPictureStatus.OK)
MessageBox.Show("The example has been followed successfully and the file has been saved.", "Example: DeleteCustomPDFInformation");
else
MessageBox.Show("The example has been followed successfully, but the file can't be saved. Status: " + status.ToString(), "Example: DeleteCustomPDFInformation");
}
else
MessageBox.Show("The DeleteCustomPDFInformation() method has failed with the status: " + status.ToString(), "Example: DeleteCustomPDFInformation");
}
else
MessageBox.Show("Your PDF document does not contain custom key gdpicture.", "Example: DeleteCustomPDFInformation");
}
}
else
{
MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: DeleteCustomPDFInformation");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: DeleteCustomPDFInformation");
}
gdpicturePDF.Dispose();