Removing certified signature from PDF fails

When trying to remove a signatur from a certified PDF I receive the following error: “You cannot change this document because it is certified.”

I’m running Aspose.PDF v. 20.6.0 on .NET.

To remove the signature I execute the followwing code:

try
{
var pdfFileSignature = new PdfFileSignature(pdf);
if (pdfFileSignature.ContainsSignature())
{
foreach (var name in pdfFileSignature.GetSignNames())
pdfFileSignature.RemoveSignature((string) name);
}
}
catch (Exception e)
{
var message = $“Failed trying to remove signature for file: {pdf.FileName}”;
Logger.Warn(e, message);
throw new Exception(message, e);
}

The code works perfectly when the PDF only contains signature and it not certified.

How can I be able to remove signatures from certified PDF’s?

Certified PDF Example:
samplecertifiedpdf.pdf (56.7 KB)

@doktorres

We are afraid that you can not remove signatures from certified PDF files. Please note that Aspose.PDF mimics the behavior of Adobe Acrobat so please share if you are able to remove the signatures using Adobe Acrobat while mentioning those steps and generated PDF file so that we may proceed to help you out.

Hi Mudassir,

It is possible to remove the certification from the PDF using Adobe Acrobat.
If you go to file -> Print -> Microsoft Print to PDF. Then the signatur will be removed.

Can I somehow use the same functionalitet to Convert" or save the PDF?

See the examples below. One with a certified signature, and the same PDF that I have printed to PDF.

"SamlePrintedPDF.pdf (19.6 KB)
samplecertifiedpdf.pdf (56.7 KB)

@doktorres

You can print the PDF file similarly with Aspose.PDF for .NET API and share you feedback. I suggest you to please visit Printing PDF in .NET Framework for your convenience.