Created
December 3, 2019 10:55
-
-
Save SumindaD/bd419a2b8b6657cb5238108ade681ee5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 GemBox.Pdf; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace SignPDF | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// If using Professional version, put your serial key below. | |
ComponentInfo.SetLicense("FREE-LIMITED-KEY"); | |
using (var document = PdfDocument.Load("Test.pdf")) | |
{ | |
// Add an invisible signature field to the PDF document. | |
var signatureField = document.Form.Fields.AddSignature(); | |
// Initiate signing of a PDF file with the specified digital ID file and the password. | |
signatureField.Sign("PrivateKeyCert.pfx", "1234"); | |
// Finish signing of a PDF file. | |
document.Save("SignedDocument.pdf"); | |
} | |
Console.WriteLine("Signed!"); | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment