Hi,
I want to know weather aspose supporting pdf digital signature. If yes
help me in this regard with the code sample
Thanks
Shilpi Sharma
Hi,
I want to know weather aspose supporting pdf digital signature. If yes
help me in this regard with the code sample
Thanks
Shilpi Sharma
Hi Shilpi,
Thanks for your inquiry.
Aspose.Pdf for .NET supports the feature to digitally sign the PDF documents. Please check following code snippet, in order to sign the PDF.
string pbxFile = dataDir + “{your .pfx file}”;
string inFile = dataDir + @"DigitallySign.pdf";
string outFile = dataDir + @"DigitallySign_out.pdf";
using (Document document = new Document(inFile))
{
using (Facades.PdfFileSignature signature = new Facades.PdfFileSignature(document))
{
PKCS7 pkcs = new PKCS7(pbxFile, "{password}"); // Use PKCS7/PKCS7Detached objects
DocMDPSignature docMdpSignature = new DocMDPSignature(pkcs, DocMDPAccessPermissions.FillingInForms);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
// Set signature appearance
signature.SignatureAppearance = dataDir + @"aspose-logo.jpg";
// Create any of the three signature types
signature.Certify(1, "Signature Reason", "Contact", "Location", true, rect, docMdpSignature);
// Save output PDF file
signature.Save(outFile);
}
}
For more information, please refer to “Digitally sign PDF file” article in our API documentation. In case of any further assistance, please feel free to contact us.
Best Regards,