Quantcast
Channel: Developer Express Global
Viewing all articles
Browse latest Browse all 3389

Blog Post: 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?

Visual signatures are document widgets that link digital signatures with logos, photos and text. Users can embed these visuals into documents to help readers see who signed the PDF and to obtain additional non-visual 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 3389

Trending Articles