Last active
August 3, 2023 07:38
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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