Dim caption As String = "RemoveSignature"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
Dim signatureCount As Integer = gdpicturePDF.GetSignatureCount()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If signatureCount > 0 Then
status = gdpicturePDF.RemoveSignature(signatureCount - 1)
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SaveToFile("test_RemoveSignature.pdf")
If status = GdPictureStatus.OK Then
MessageBox.Show("The signature has been removed successfully and the file has been saved.", caption)
Else
MessageBox.Show("The signature has been removed successfully, but the file can't be saved. Status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The RemoveSignature() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("This PDF document doesn't contain any digital signature.", caption)
End If
Else
MessageBox.Show("The GetSignatureCount() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "RemoveSignature";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
int signatureCount = gdpicturePDF.GetSignatureCount();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (signatureCount > 0)
{
status = gdpicturePDF.RemoveSignature(signatureCount - 1);
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SaveToFile("test_RemoveSignature.pdf");
if (status == GdPictureStatus.OK)
MessageBox.Show("The signature has been removed successfully and the file has been saved.", caption);
else
MessageBox.Show("The signature has been removed successfully, but the file can't be saved. Status: " + status.ToString(), caption);
}
else
MessageBox.Show("The RemoveSignature() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("This PDF document doesn't contain any digital signature.", caption);
}
else
MessageBox.Show("The GetSignatureCount() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();