We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Initial permissions of document changes when using PDF Kit. Why?

Hi!

We have some PDFs that initially are editable and savable using Adobe Reader. However, once we add content to fields using Aspose PDF Kit for Java and makes the documents available to users there are no longer any ways of saving the document - only printing is possible. If we flatten the fields in the document it will be savable, but we would like to keep the document editable having pre-filled some fields and let the users fill in the rest later.

It works fine when using Adobe Acrobat Pro, as mention here https://forum.aspose.com/t/110248, in post 289392 in reply to 289283:
"Although, some privileges, in Adobe Reader, are shown to be not allowed, however, in the Adobe Acrobat you can see that all privileges are allowed and this document is editable in any way. "

Privliges are, as mentioned here, shown differently for Adobe Acrobat (Pro) and Adobe Reader. It could have been a solution, but the pricing of all licenses required to upgrade all users to this is just to high.

This is what we have tried:
(sorry, we are not able to provide the exact source code of what we tried at the moment)

fileSecurity.setPrivilege(PdfPrivilege.AllowAll) and other priviliges and fileSecurity.decryptFile(""), and any combination of these. Whatever we do here makes no difference for our scanario, only changes values under File - Properties - Security - Show details (Adobe Reader). Instead we would like to change those under File - Properties - Security - Document Restrictions Summary (or seemingly as it seems to be these that are actually preventing us), but these values only seem to be getting more "strict" after having inputted values and closed the form - not less strict as we want. It is as though processing a document through Aspose PDF Kit for Java somehow changes the initial permissions of the document!

Note: sometimes we do end up with a "java.io.IOException: PDF header signature error." when attempting the above (seems to be a matter of the sequence of which we do things). Could you also give us a quick run-down of why this is?

Generally what we want is your recommended way of making sure the document is editable and savable after having processed it - in our case just filled out a few text fields.

In advance, thanks a lot for any comments that may help us solve this!

Best regards,
Thor

Hi Thor,


Thank you gor the details.

We are looking into your issue and will reply you soon.

Sorry for the delay and inconvenience,

Hi Thor,


Thanks for your patience.

I have gone through your requirements in detail and as per my understanding, you have a PDF form with extended rights enabled where end users can open the document with some pre-filled fields, enter data in required fields and can save the document using Adobe Reader (instead of Adobe Acrobat which allows but you are not willing to have this option due to licensing cost). Now the problem that you are facing is that once you have processed the document with Aspose.Pdf.Kit for Java, document can be filled but it cannot be saved unless you use FlattenField method where you can save the document but data cannot be entered inside form fields.

You have also tried fileSecurity.setPrivilege(PdfPrivilege.AllowAll) and other priviliges and fileSecurity.decryptFile(""), method but this way you are getting “java.io.IOException”. But in order for us to test this scenario we would be requiring sample input document and the code snippet that you are using (eventhough you have shared that code snippet cannot be shared, but you can only share the portion where you are performing these operations).

Please acknowledge that I have properly understood the problem and share the required resources so that we can further investigate this issue at our end. We are really sorry for this inconvenience.