How to Remove Signature From PDF using C#

This quick tutorial guides on how to remove signature from PDF using C#. It contains the basic steps to delete signature from PDF using C# along with the runnable sample code demonstrating the feature. You will also learn to delete all the signatures from a PDF file or delete a particular signature based upon its name.

Steps to Remove a Signature from a PDF using C#

  1. Configure the IDE to add Aspose.PDF using the NuGet package manager to remove signatures
  2. Create an object of PdfFileSignature
  3. Bind the source PDF with the PdfFileSignature object
  4. Get the list of all signature names using the GetSignNames() method
  5. Iterate through all the signatures and delete the desired signatures using the RemoveSignature() method
  6. Save the output PDF after deleting the signatures

These steps specify the process to remove electronic signature from PDF using C#. First, the source PDF file is bound with the PdfFileSignature class object that contains GetSignNames() method to access all the signatures and the RemoveSignature() method to remove an individual signature. In the final step, you may save the resultant PDF file on the disk or to a memory stream as per your requirements.

Code to Remove Digital Signature from PDF using C#

This code demonstrates how to delete signature from PDF using C#. The PdfFileSignature class is used for removing the signature however this class contains a lot of other features as well like checking if the source file is certified or not, checking the LTV enabled flag, checking if the file contains a signature or not, verifying a signature, etc. to list a few. Note that while using the RemoveSignature() method, you can also set the flag to either remove the signature only or remove the signature and field both.

This tutorial has guided us to remove a signature from the PDF file. If you want to learn to protect a PDF file, refer to the article on how to protect PDF with Password in C#.