[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Collapse]PDF Document API
   Getting Started
   Coordinate Systems
   Document Generation
  [Expand]PDF Graphics
  [Expand]Document Manipulation
  [Expand]Additional Content
  [Expand]Interactive Forms
  [Expand]Text Markup Annotations
  [Collapse]Document Security
    Document Protection
    Signing Document
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Signing Document

This topic explains why it is necessary to sign a document and how this can be done using the PDF Document API component.

Expanded Overview

The PDF Document API allows you to electronically sign a document. A digital signature is used to help authenticate the identity of a user and document content.

To sign a document, a digital certificate is required. This certificate is issued by a Certification Authority (CA). The role of the CA is to validate the holder's identity and provide access to a certificate.

To learn how to apply a signature to a document, refer to the How to Sign document section.

Expanded Prerequisite

Before signing, the PDF Document API component must have a document (e.g., you can load a document using the PdfDocumentProcessor.LoadDocument method).

Expanded How to Sign

Access a signing certificate.

You can either get it from a third-party certificate authority (CA), or generate the X.509 certificate with a private key and public key pair using, e.g, the Makecert.exe (Certificate Creation Tool) for testing purposes only.

Create a visual signature and specify the signing information.

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.

A signature is represented by an instance of the PdfSignature object with the specified certificate and other settings. The signature can be accessed using the PdfSaveOptions.Signature property.

You can create a visual signature using one of the PdfSignature (see PdfSignature.PdfSignature) constructor overloads that takes 4 arguments. For example, using a certificate, image data represented by a byte array, and specifying the page number and signature bounds. The signature bounds are represented by a PdfOrientedRectangle object. You can specify the rotation angle for the signature (in radians) when creating a PdfOrientedRectangle object. A positive angle means counterclockwise rotation; a negative angle means clockwise rotation.

Specify the signing information using the following properties.

Member Description
PdfSignature.Name Gets or sets the name of the person or authority signing the document.
PdfSignature.Location Gets or sets the CPU host name or physical location of the signature.
PdfSignature.Reason Gets or sets the reason for a document signature.
PdfSignature.ContactInfo Specifies the contact information which helps a recipient to verify the signature provided by the signer.

In addition, you can use the PdfSignature.SigningTime property to get a signing time. This property is used to validate the signature.

Save a signed document.

To accomplish this task, call the PdfDocumentProcessor.SaveDocument method and pass the PdfSaveOptions object containing a signature as a parameter.

Expanded Example

The following example shows how to sign a document with a visual signature.

Expanded See Also

Is this topic helpful?​​​​​​​