Click or drag to resize
Pdf Library for .NET

PdfDigitalSignatureElement Class

Represents a digital signature in a document.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfPageElement
    SelectPdf.UniversalPdfDigitalSignatureElement

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class PdfDigitalSignatureElement : PdfPageElement

The PdfDigitalSignatureElement type exposes the following members.

Constructors
 NameDescription
Public methodPdfDigitalSignatureElement(RectangleF, PdfDigitalCertificate) Constructs a digital signature element that can be added to a pdf document page.
Public methodPdfDigitalSignatureElement(Single, Single, Single, Single, PdfDigitalCertificate) Convenience overload — creates the signature from explicit x / y / width / height values.
Top
Properties
 NameDescription
Public propertyActualText Gets or sets the exact text represented by this element (the structure element's /ActualText entry), used when the drawn glyphs do not map to readable text.
(Inherited from PdfPageElement)
Public propertyAlternateText Gets or sets the alternate text describing this element for assistive technology (the structure element's /Alt entry). Required on figures for PDF/UA conformance.
(Inherited from PdfPageElement)
Public propertyArtifact Gets or sets a value indicating whether this element is an artifact — decorative or layout content that carries no meaning and is excluded from the logical structure (backgrounds, rules, running headers). Takes precedence over TagType.
(Inherited from PdfPageElement)
Public propertyCertificate Gets the certificate used to create the signature.
Public propertyContactInfo Gets or sets the contact information.
Public propertyLocation Gets or sets the location of the signing.
Public propertyReason Gets or sets the reason for the signing.
Public propertyTagType Gets or sets the structure type used to tag this element in a tagged (accessible) document. Ignored unless the document's tagged mode (PdfDocument.Tagged) is enabled. Null (default) leaves the element untagged unless Artifact is set.
(Inherited from PdfPageElement)
Top
Methods
 NameDescription
Public methodSetDate Specify the date when the document was signed. If this method is not called, the current date is set by default.
Top
Remarks
Add the element to a page of a document being built from scratch. The signature is applied — and its visible appearance drawn in the given rectangle — when the document is saved.
Example
PdfDigitalCertificatesCollection certs =
    PdfDigitalCertificatesStore.GetCertificates(@"C:\certs\signer.pfx", "secret");

PdfDocument document = new PdfDocument();
PdfPage page = document.AddPage();

SelectPdf.Universal.Drawing.RectangleF bounds =
    new SelectPdf.Universal.Drawing.RectangleF(60, 60, 240, 70);
PdfDigitalSignatureElement signature =
    new PdfDigitalSignatureElement(bounds, certs[0]);
signature.Reason = "I approve this document";
signature.Location = "Bucharest";
page.Add(signature);

document.Save("signed.pdf");
See Also