Sign Document
Adds a digital signature to a PDF document.
Code
using DRIT.Pdf;
using var doc = new PdfDocument();
var page = doc.Pages.Add(PdfPageSize.A4);
page.Content.DrawText("Signed document", new PdfPoint(100, 700));
// Add a signature field
var signature = doc.Forms.AddSignature(new PdfRect(100, 600, 200, 50), "signature1");
// Sign the document
doc.Sign(signature, new PdfSigningOptions
{
// Signing options here
});
doc.Save("signed.pdf");