Quantcast
Channel: Developer Express Inc.
Viewing all articles
Browse latest Browse all 2370

PDF Document API - Visual Signatures (v18.2)

$
0
0

As you may already know, the PDF Document API provides the capability to sign documents. With our upcoming release, users will get the ability to insert visual signatures into the documents. 

What Are Visual Signatures?

The visual signature is an electronic signature with a visual appearance represented as an image placed on a document page. For this purpose, facsimile pictures are usually used. This approach has the following advantages compared with non-visual signatures: 

  • You can immediately see that a PDF document is signed.
  • You understand who signed this document.
  • You can click on the signature image to see signature data.

How to Create a Visual Signature

You can create a visual signature using one of the PdfSignature constructor overloads that takes 4 arguments. You need to specify a certificate, a signature image data, the page number where the image should be added and signature bounds. 

using (PdfDocumentProcessor documentProcessor = new PdfDocumentProcessor()) {

  documentProcessor.LoadDocument("UnsignedDocument.pdf");

  var certificate = new X509Certificate2("Cetrtificate.pfx", "dxdemo");

  var imageData = File.ReadAllBytes("Signature.png");

  var signature = new PdfSignature(certificate, imageData,
    1, new PdfRectangle(120, 210, 250, 390));

  signature.Location = "USA";
  signature.ContactInfo = "john.smith@example.com";
  signature.Reason = "Approved";

  var saveOptions = new PdfSaveOptions() { Signature = signature };

  documentProcessor.SaveDocument("SignedDocument.pdf", saveOptions);
}

As usual, we appreciate any feedback. Please tell us in the comments bellow or contact us at officeteam@devexpress.com. It would also help us if you could answer a question in this survey. 


Viewing all articles
Browse latest Browse all 2370

Trending Articles