Back to Devexpress

PdfSignatureFieldInfo Class

officefileapi-devexpress-dot-pdf-12805999.md

latest3.3 KB
Original Source

PdfSignatureFieldInfo Class

Contains information about the signature field.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public class PdfSignatureFieldInfo
vb
Public Class PdfSignatureFieldInfo

Remarks

Use the PdfSignatureFieldInfo object to create and sign a new signature field. Pass the PdfSignatureFieldInfo object as the PdfSignatureBuilder constructor parameter.

The PdfSignatureFieldInfo class properties allow you to specify the field’s name, location, annotation flags, and rotation angle.

The code sample below shows how to use the PdfSignatureFieldInfo object to create and sign a new signature field:

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

/ /Load a document to be signed
using (var signer = new PdfDocumentSigner("SignedDocument.pdf"))
{
    // Specify the name and location of the signature field
    var description = new PdfSignatureFieldInfo(1);
    description.Name = "SignatureField";
    description.SignatureBounds = new PdfRectangle(10, 10, 150, 150);

    // Create a PKCS#7 signature
    Pkcs7Signer signature = new Pkcs7Signer("Signing Documents//testcert.pfx", "123", HashAlgorithmType.SHA256);

    // Apply a signature to a new form field
    var signatureBuilder = new PdfSignatureBuilder(signature, description);

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

    // Sign and save the document
    signer.SaveDocument("out2.pdf", signatureBuilder);
}
vb
Imports DevExpress.Pdf
Imports DevExpress.Office.DigitalSignatures

' Load a document to be signed
Using signer = New PdfDocumentSigner("SignedDocument.pdf")

  'Specify the name and location of the signature field
  Dim description = New PdfSignatureFieldInfo(1)
  description.Name = "SignatureField"
  description.SignatureBounds = New PdfRectangle(10, 10, 150, 150)

  'Create a PKCS#7 signature
  Dim signature As Pkcs7Signer = New Pkcs7Signer("Signing Documents//testcert.pfx", "123", HashAlgorithmType.SHA256)

  'Apply a signature to a new form field
  Dim signatureBuilder = New PdfSignatureBuilder(signature, description)

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

  'Sign and save the document
  signer.SaveDocument("out2.pdf", signatureBuilder)
End Using

Inheritance

Object PdfSignatureFieldInfo

See Also

PdfSignatureFieldInfo Members

DevExpress.Pdf Namespace