SignatureField lock information

Is there any way to access the lock dictionary of a signature field? We need to know what fields a signature field locks (signs, sets as readonly)

Hi There,

Thanks for contacting support.

Aspose.Pdf for .NET supports the feature to digitally sign the PDF files using the SignatureField class. You can also certify a PDF file with a PKCS12-Certificate. Something similar to Adding Signatures and Security in Adobe Acrobat.

When signing a PDF document using a signature, you basically confirm its contents “as is”. Consequently, any other changes made afterwards invalidate the signature and thus, you would know if the document was altered. Whereas, certifying a document first allows you to specify the changes that a user can make to the document without invalidating the certification.

In other words, the document would still be considered to retain its integrity and the recipient could still trust the document. For further details, please visit [Certifying and signing a PDF] (http://www.investintech.com/resources/articles/certifyingsigningpdf/). In general, certifying a document can be compared to Code-signing a .NET executable.

If you need further assistance, please feel free to contact us.

Best Regards,

We have a requirement to use multiple digital signature fields on a report. Each digital signature is tied to a group of form fields. Basically like an instructor signs for his form fields and a student signs for his form fields in different sections of the document. We need to know which form field goes with each signature block programmatically so we know what fields to prepopulate based on if there is a digital signature for that group.

Hi Troy,

Thanks for contacting support.

Aspose.Pdf for .NET supports the feature to add Form fields inside the PDF file and also add digital signatures inside PDF document. So as per your requirement, you can programatically add Signature fields and then render the document for each user, so that they can add their signature inside the field. For more information, please visit Digitally sign PDF file.

The following code snippet shows the steps to add signature fields and then add digital signature in specified form fields.

[C#]

Document doc = new Document(@“input.pdf”);

//place empty signatures
Aspose.Pdf.Forms.SignatureField s1 = new Aspose.Pdf.Forms.SignatureField(doc.Pages[1], new Aspose.Pdf.Rectangle(200, 200, 300, 100));

Aspose.Pdf.Forms.SignatureField s2 = new Aspose.Pdf.Forms.SignatureField(doc.Pages[2], new Aspose.Pdf.Rectangle(200, 200, 300, 100));

doc.Form.Add(s1);

doc.Form.Add(s2);

doc.Save("presign_output.pdf");

//create PdfFileSignature object and bind input and output PDF files

Aspose.Pdf.Facades.PdfFileSignature pdfSign = new Aspose.Pdf.Facades.PdfFileSignature(@"presign_output.pdf", @"sign_output.pdf");

//create any of the three signature types

Aspose.Pdf.Forms.PKCS1 signature1 = new Aspose.Pdf.Forms.PKCS1(@"test1.pfx", "test1");

signature1.Reason = "Signature Reason";

signature1.ContactInfo = "Contact";

signature1.Location = "Location";

Aspose.Pdf.Forms.PKCS1 signature2 = new Aspose.Pdf.Forms.PKCS1(@"test1.pfx", "test1");

signature2.Reason = "Signature Reason";

signature2.ContactInfo = "Contact";

signature2.Location = "Location";

//place first signature

pdfSign.Sign(s1.PartialName, signature1);

pdfSign.Save();

//place second signature

pdfSign = new Aspose.Pdf.Facades.PdfFileSignature(@"sign_output.pdf", @"sign_output.pdf");

pdfSign.Sign(s2.PartialName, signature2);

pdfSign.Save();