PdfSignatureField Class
Represents signature field in the PDF Form.
Inheritance
System.Object
PdfSignatureField
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfSignatureField : PdfSignatureAppearanceField, IPdfWrapper, INotifyPropertyChanged
Remarks
Please refer the UG docuemntation link https://help.syncfusion.com/file-formats/pdf/working-with-digitalsignature#signing-an-existing-document for more details about signature field.
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create signature field
PdfSignatureField sign = new PdfSignatureField(page, "sign1");
sign.Bounds = new RectangleF(100, 420, 100, 50);
document.Form.Fields.Add(sign);
document.Save("Form.pdf");
document.Close(true);
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
'Create signature field
Dim sign As PdfSignatureField = New PdfSignatureField(page, "sign1")
sign.Bounds = New RectangleF(100, 420, 100, 50)
document.Form.Fields.Add(sign)
document.Save("Form.pdf")
document.Close(True)
Constructors
PdfSignatureField(PdfPageBase, String)
Initializes a new instance of the PdfSignatureField class with the specific page and name.
Declaration
public PdfSignatureField(PdfPageBase page, string name)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | Page which the field to be placed on. |
System.String | name | The name of the field. |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create signature field
PdfSignatureField sign = new PdfSignatureField(page, "sign1");
sign.Bounds = new RectangleF(100, 420, 100, 50);
document.Form.Fields.Add(sign);
document.Save("Form.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
'Create signature field
Dim sign As PdfSignatureField = New PdfSignatureField(page, "sign1")
sign.Bounds = New RectangleF(100, 420, 100, 50)
document.Form.Fields.Add(sign)
document.Save("Form.pdf")
See Also
Properties
Appearance
Gets the visual appearance of this field.[Read-Only]
Declaration
public PdfAppearance Appearance { get; }
Property Value
Type |
---|
PdfAppearance |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create signature field
PdfSignatureField sign = new PdfSignatureField(page, "sign1");
sign.Bounds = new RectangleF(100, 420, 100, 50);
// Gets the signature appearance
PdfAppearance appearance = sign.Appearance;
document.Form.Fields.Add(sign);
document.Save("Form.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
'Create signature field
Dim sign As PdfSignatureField = New PdfSignatureField(page, "sign1")
' Gets the signature appearance
Dim appearance As PdfAppearance = sign.Appearance
sign.Bounds = New RectangleF(100, 420, 100, 50)
document.Form.Fields.Add(sign)
document.Save("Form.pdf")
See Also
Signature
Gets or sets the digital signature for signing the field.
Declaration
public PdfSignature Signature { get; set; }
Property Value
Type |
---|
PdfSignature |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create signature field
PdfSignatureField sign = new PdfSignatureField(page, "sign1");
sign.Signature = new PdfSignature(page, new PdfCertificate("PDF.pfx", "Syncfusion"), "Signature");
sign.Bounds = new RectangleF(100, 420, 100, 50);
// Gets the signature appearance
PdfAppearance appearance = sign.Appearance;
document.Form.Fields.Add(sign);
document.Save("Form.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
'Create signature field
Dim sign As PdfSignatureField = New PdfSignatureField(page, "sign1")
sign.Signature = New PdfSignature(page, New PdfCertificate("PDF.pfx", "Syncfusion"), "Signature")
sign.Bounds = New RectangleF(100, 420, 100, 50)
document.Form.Fields.Add(sign)
document.Save("Form.pdf")
See Also
Methods
DrawAppearance(PdfTemplate)
Draws the appearance.
Declaration
protected override void DrawAppearance(PdfTemplate template)
Parameters
Type | Name | Description |
---|---|---|
PdfTemplate | template | The template. |
Overrides
Initialize()
Initializes an instance.
Declaration
protected override void Initialize()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged