I have been using MuPDF 1.2 for a while in my android application. I have protected PDfs owner's and user's password, MuPDF 1.2 asks me to enter user's password to be able to preview the PDF. I never used the highlighting feature in MUPDF 1.2 so I am not familiar with MuPDF handling protected PDF with owner password, so then I decided to upgrade the version of MuPDF to 1.4, no major changes on the android for me. what I am trying to accomplish now is allow the user to draw of the PDF using MuPDF 1.4, the issue is: MuPDF 1.4 fail to save user drawing on the PDF, my closest guess is because it's protected with owner password, I have looked up the save function `MuPDFCore_saveInternal` but it does not have password parameter in order to save the PDF drawings. Please let me know if I need to modify anything on order to make this work, or should I understand that MuPDF 1.4 does not support drawings on protected PDF when using both users and owner password. many thanks.
Unfortunately MuPDF does not currently support writing out encrypted PDFs. However, it looks like we actually try to do so, and end up writing unencrypted annotations to the end of the original encrypted file. Although the save succeeds, re-loading the modified PDF silently fails, and the annotations are not displayed (only the original content). This file corruption is a bug which we will fix for now by disabling annotation editing for encrypted files. We recommend that you do the same for your application (once I've implemented this, I'll post the commit here, so you can see how it can be done). Ideally though, in the long term, we'd be able to support saving out of encrypted files, so I'll open a separate enhancement bug for this feature. Thanks for reporting this issue.
Opened bug #695336 to track feature request for saving annotations to encrypted files.
commit 063a723b9fa50200192b01ba976ecd551461a8dc Author: Matt Holgate <matt@emobix.co.uk> Date: Fri Jun 27 12:30:39 2014 +0100 Fix #695217 - don't allow annotation of encrypted PDFs commit 5587d318d8495d15fb9157ea8c0a925e6e590e00 Author: Matt Holgate <matt@emobix.co.uk> Date: Fri Jun 27 15:11:00 2014 +0100 iOS - Fix #695217 - don't allow annotation of encrypted PDFs
Closing this, as it's now not possible to annotate an encrypted file, and the separate bug #695336 has been opened to track the enhancement to implement this.