Skip to content

Instantly share code, notes, and snippets.

How to Sign PDF with Text Signature using C#. For more information, please follow link: https://kb.groupdocs.com/signature/net/how-to-sign-pdf-with-text-signature-using-csharp/
using GroupDocs.Signature;
using GroupDocs.Signature.Domain;
using GroupDocs.Signature.Options;
namespace SignPDFwithTextSignatureUsingCSharp
{
internal class Program
{
static void Main(string[] args)
{
// Set License to avoid the limitations of Signature library
License lic = new License();
lic.SetLicense(@"GroupDocs.Signature.lic");
// load the source PDF file
using (Signature signature = new Signature("input.pdf"))
{
// Set some options for text signature
TextSignOptions options = new TextSignOptions("John Smith")
{
// set signature position
Left = 100,
Top = 100,
// set signature rectangle
Width = 100,
Height = 30,
Font = new SignatureFont { Size = 12, FamilyName = "Comic Sans MS" },
Text = "Sign PDF using Text Signature",
DocumentType = DocumentType.WordProcessing,
Border = new Border { Visible = true }
};
// Save and sign the output PDF
signature.Sign("output.pdf", options);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment