Signature
Represents a Signature form field.
public class Signature : FormElement, ISerializable
Public Class Signature
Inherits FormElement
Implements ISerializable
Inheritance: ObjectPageElementTaggablePageElementFormElementSignature
Implements: ISerializable
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to create a signature and sign it with a certificate.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Forms
Imports ceTe.DynamicPDF.Text
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page
Dim page As Page = New Page
'Create a signature form field
Dim signature As Signature = New Signature("MySigField", 10, 10, 300, 100)
Dim myFont As OpenTypeFont = New OpenTypeFont("fontname")
signature.Font = myFont
' Set a full background image
signature.FullPanel.SetImage("C:\MyImage.gif")
' Set new color property for the left panel text
signature.LeftPanel.TextColor = RgbColor.Red
' Add signature field to the page
page.Elements.Add(signature)
' Add the page to the document
document.Pages.Add(page)
Dim certificate As Certificate = New Certificate("c:\MyPersonalCertificate.pfx", "MyPassword")
' Sign the document referring the sign field
document.Sign("MySigField", certificate)
' Save the document
document.Draw("C:\MySignedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;
using ceTe.DynamicPDF.Text;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Create a signature form field
Signature signature = new Signature("MySigField", 10, 10, 300, 100);
OpenTypeFont myFont = new OpenTypeFont("fontname");
signature.Font = myFont;
// Set a full background image
signature.FullPanel.SetImage(@"C:\MyImage.gif");
// Set new color property for the left panel text
signature.LeftPanel.TextColor = RgbColor.Red;
// Add signature field to the page
page.Elements.Add(signature);
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate from the file
Certificate certificate = new Certificate(@"c:\MyPersonalCertificate.pfx", "MyPassword");
// Sign the document referring the sign field
document.Sign("MySigField", certificate);
// Save the document
document.Draw(@"C:\MySignedDocument.pdf");
}
}
Remarks
NOTE: This class required the .NET Framework 2.0 or greater.
The signature can be of visible or invisible. Use this constructor to create a visible signature field. For creating a invisible field refer Sign(System.String,ceTe.DynamicPDF.Certificate) . A signature field that does not have corresponding entry at Sign(System.String,ceTe.DynamicPDF.Certificate) will behave as empty signature field and can be signed later. The visible signature field is divided into three panels.- Left or Top Panel By default this panel holds the subject name of the given certificate.
- Right or Bottom Panel This panel is set to hold information related with certificate and the signer.
- Full Panel This panel constitutes complete area of the signature. It does not hold any default values, but can be used to show up full area text or image.
Constructors
| Signature(String, Single, Single, Single, Single) | Initializes a new instance of the signature. |
Properties
| BackgroundColor | Gets or Sets the fill/background color of a form field. (Inherited from FormElement) |
| BorderColor | Gets or Sets the border color of a form field. (Inherited from FormElement) |
| BorderStyle | Gets or Sets the BorderStyle . (Inherited from FormElement) |
| Font | Gets or sets Font . |
| FullPanel | Gets the SignaturePanel for the full panel. |
| Height | Gets or Sets the height of a form field. (Inherited from FormElement) |
| ID | Gets or sets the ID of the page element. (Inherited from PageElement) |
| IgnoreMargins | Gets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property. (Inherited from PageElement) |
| LeftPanel | Gets the SignaturePanel for the left panel. |
| Location | Gets or sets a value indicating the location of signing. |
| MappingName | Gets or Sets an mapping name, of a form field. (Inherited from FormElement) |
| Name | Gets or Sets the name of a form field. (Inherited from FormElement) |
| Output | Gets or sets output options for the field. (Inherited from FormElement) |
| PanelLayout | Gets or sets the SignaturePanelLayout specifying how the panels should be laidout. |
| Printable | Gets or Sets the form field printable on Pdf. By default its true. (Inherited from FormElement) |
| ReaderEvents | Gets the reader events of the annotation. (Inherited from FormElement) |
| ReadOnly | Gets or Sets the read only property status of the form field. (Inherited from FormElement) |
| Reason | Gets or sets a value indicating the reason of signing the document. |
| RelativeTo | Gets and sets placement of the page element on the page. (Inherited from PageElement) |
| RightPanel | Gets the SignaturePanel for the right panel. |
| Rotate | Gets or Sets the angle of a form field.
Rotation angle should be multiple of 90, default is 0. (Inherited from FormElement) |
| Tag | Gets or sets the structure element of the form element. (Inherited from FormElement) |
| TagOrder | Gets or sets the tag order of the taggable element. (Inherited from TaggablePageElement) |
| TextColor | Gets or Sets the color of the text for the field. (Inherited from FormElement) |
| ToolTip | Gets or Sets an alternate field name, of a form field. (Inherited from FormElement) |
| Visible | Gets or Sets the form field visible on Pdf. By default its true. (Inherited from FormElement) |
| Width | Gets or Sets the width of a form field. (Inherited from FormElement) |
| X | Gets or Sets the X coordinate of a form field. (Inherited from FormElement) |
| Y | Gets or Sets the Y coordinate of a form field. (Inherited from FormElement) |
Methods
| Draw(PageWriter) | Draws the signature to the given PageWriter object. |
| Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
| GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
| GetType() | Gets the Type of the current instance. (Inherited from Object) |
| HideAllText() | Hides all text visibility in all the panels. |
| ToString() | Returns a String that represents the current Object . (Inherited from Object) |