PDF Digital Signature

Digitally sign PDF documents with free cross-platform Apps and APIs.

How to add Digitally Sign to PDF File

In order to add sign in PDF file, we’ll use Aspose.PDF API which is a feature-rich, powerful and easy to use document manipulation API. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console. When signing a PDF document using a signature, you basically confirm its contents “as is”. Consequently, any other changes made afterward invalidate the signature and thus, you would know if the document was altered.

You can use following classed and method for PDF signing

  1. Class DocMDPSignature.
  2. Enumeration DocMDPAccessPermissions.
  3. Property IsCertified in PdfFileSignature class.

Sign PDF with digital signatures

This sample code shows how to sign PDF File

   var esign_doc = new Document("My File.pdf");
    var page = esign_doc.PdfDocument.Pages[1];
    // Create text stamp
    TextStamp textStamp = new TextStamp(getFormattedText("digital signature text"));
    // Set whether stamp is background
    // textStamp.Background = true;
    textStamp.HorizontalAlignment = HorizontalAlignment.Right;
    textStamp.VerticalAlignment = VerticalAlignment.Bottom;
    textStamp.TextAlignment = HorizontalAlignment.Center;
    textStamp.TextState.Font = FontRepository.FindFont("Arial");
    textStamp.TextState.FontSize = 50;
    textStamp.Width = page.PageInfo.Width / 3;
    textStamp.TextState.ForegroundColor = Color.FromRgb(System.Drawing.Color.Aqua);
    page.AddStamp(textStamp);

    esign_doc.Save("esignedFile.pdf", SaveFormat.Pdf);