I want to disallow everything but modifying annotations in a PDF.
However, when I follow the instructions in the API reference, the PDFs generated allow annotations AND filling in form fields and signing.
Here is the code being used:
// Create encryption details and set owner password. PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails("", "password", PdfEncryptionAlgorithm.RC_4_128); // Start by disallowing all permissions. encryptionDetails.setPermissions(PdfPermissions.DISALLOW_ALL); // Extend permissions to allow modifying annotations. encryptionDetails.setPermissions(PdfPermissions.MODIFY_ANNOTATIONS); saveOptions.setEncryptionDetails(encryptionDetails); // Render the document to PDF format with the specified permissions. doc.save("output.pdf", saveOptions);
I note that the API docs for
Class PdfPermissions under
static final int FILL_IN:
Allows filling in forms and signing the document. When using RC4 40-bit encryption, this option is ignored and filling in form is allowed whenever MODIFY_ANNOTATIONS is set.
So it seems like the Aspose software is acting as if the document is being encrypted with 40-bit encryption.
Here is are the permissions on the output document as shown in Acrobat DC:
Screen Shot 2019-07-16 at 6.55.09 PM.jpg (188.4 KB)
Any guesses, Aspose team, as to what is going on?