All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfDocumentSigner.SaveDocument(String, PdfSignatureBuilder[]) Method

Saves the PDF document to a file with the specified document signatures.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.1.dll

Declaration

public void SaveDocument(
    string filePath,
    params PdfSignatureBuilder[] signatures
)

Parameters

Name Type Description
filePath String

The path to a file into which to save the document.

signatures PdfSignatureBuilder[]

An array of signatures to apply to the document.

Remarks

Call the SaveDocument method to apply one or more signatures to the PDF document. Specify the document to be signed in the PdfDocumentSigner object’s constructor.

You can add a signature to the existing signature field. Create a new PdfSignatureBuilder object with the signature field’s name passed as the constructor’s parameter.

Use the PdfSignatureFieldInfo instance in the PdfSignatureBuilder object constructor to create a new signature field. You can specify the field’s name, bounds and rotation angle.

The PDF Document API supports PKCS#7 signatures. Use the Pkcs7Signer class to create this signature type. You can create a Pkcs7SignerBase descendant to use a custom object to create the PKCS#7 signature.

using DevExpress.Pdf;
using DevExpress.Office.DigitalSignatures;

//Load a document to be signed
using (var signer = new PdfDocumentSigner("Document.pdf"))
{
    //Create a PKCS#7 signature
    Pkcs7Signer pkcs7Signature = new Pkcs7Signer("Signing Documents//testcert.pfx", "123", HashAlgorithmType.SHA256);

    //Apply a signature to the Sign form field
    var signatureBuilder = new PdfSignatureBuilder(pkcs7Signature, "Sign");

    //Specify the signature's image and signer information:
    signatureBuilder.SetImageData(System.IO.File.ReadAllBytes("Signing Documents//Jane Cooper.jpg"));
    signatureBuilder.Location = "USA";
    signatureBuilder.Name = "Jane Cooper";
    signatureBuilder.Reason = "I Agree";

    //Sign and save the document
    signer.SaveDocument("SignedDocument.pdf", signatureBuilder);
}
See Also