C# code tutorial

PDF Digital Signature PDF Creating & Inserting PDF to Image PDF Extracting PDF Processing & Editing PDF Protecting PDF Chart PDF Barcode

Popular .NET SDK


A digital signature helps users authenticate Adobe PDF document and verify that the signer of PDF document is who they say they are and the content of PDF document has not been forged and tampered with. Among all types of PDF digital signature showing types, the signature in text form seems the mostly used one. All its information contained shows clearly about every change on the PDF document via transmission.

XsPDF .NET PDF signer SDK provides you with powerful text signature signing features for your C# windows and web projects development. The content of PDF text signature like information about the signer and the date are well protected with password. These are invariable encrypted information in text signature. Certainly, some aspects of the text signature is subject to customization, and the options supported by our C# PDF signer SDK contain the reason why you add this signature to PDF document and where is your location. Mature PDF signing APIs allows every signer to create and add one or more text signatures to PDF document for different purposes, at anytime needed.

How to Add Text Signature to PDF in C#

Creating and adding a text signature to sign a PDF document in C# program seems complex. But, XsPDF .NET PDF signer library makes it easy to work with. Now, have a try with C# sample code below. Simply load a PDF file, draw a personalized text signature, and add it to PDF file.


//Load the pfx certificate file with password
PdfCertificate cert = new PdfCertificate("demo.pfx", "your-password");
PdfSigner signer = new PdfSigner("demo.pdf", cert);
//Input the signature info
signer.ContactInfo = "your contact information";            
signer.Location = "your location";           
signer.Reason = "your reason";
signer.FieldName = "XsPDF Sign";
signer.PageId = 0;
signer.Rect = new Rectangle(100, 100, 100, 50);
signer.SignatureAlgorithm = SignatureAlgorithm.SHA256;
//Set signature appearance to text style
signer.SignatureShowingType = SignatureShowingType.Description;

signer.Sign("text-sign.pdf");

Notice - If you use the free trial version of .NET PDF Digital Signature SDK, the sign field is showing "XsPDF Signer Trial Version".