Free Support Forum - aspose.com

When adding Signature field cannot complete signature in adobe reader

When adding a signature to a pdf document the signature field cannot be filled in because Document restrictions doesn’t allow signing.


Code to add signature field:

FormEditor formEditor = new FormEditor(pdfDocument);
//add field
formEditor.AddField(FieldType.Signature, “signatureField”, 1, 100, 100, 200, 150);
formEditor.Save(fileName);

How can I programmatically set to allow signing?

Kind regards,
Jan

Hi Jan,


Thanks for contacting support.

In order to allow PDF signing, please try using the following code snippet. For your reference, I have attached the resultant PDF generated over my end and also the image file showing properties of PDF document.


[C#]

//create DocumentPrivileges object<o:p></o:p>

DocumentPrivilege privilege = DocumentPrivilege.FillIn;

// allow existing form fields filling and signing existing Signature fields

privilege.ChangeAllowLevel = 2;

//open PDF document

PdfFileSecurity fileSecurity = new PdfFileSecurity();

// bind source PDF file

fileSecurity.BindPdf("c:/pdftest/test_template.signed.pdf");

//set document privileges

fileSecurity.SetPrivilege(privilege);

// save PDF file with new privileges

fileSecurity.Save("c:/pdftest/test_template.signed_Allowed.pdf");