Copy link to clipboard
Copied
I have a client that has requested a fillable pdf be both password protected against editing non-form items but will also flatten the forms on save (I currently have that function as a button fyi). I know the usual security settings causes flattenPages() to fail. Are there any alternatives I can run with javascript to achieve a similar result?
Push come to shove, I'd also settle for a method that locks editing without offering the option to enter a password at all. I'm trying to keep the pdf as friendly as possible for potentially computer-illiterate end users, so special saving methods to flatten the form are out.
Any tips are greatly appreciated! I don't usually use pdfs for anything other than sending artwork to printers, I'm a bit new to all of this.
Copy link to clipboard
Copied
Once you've restricted modifying the PDF, flattenPages won't work since it changes the document and you've secured the file to prevent exactly that... and it'd never work for you in Reader because Reader can't modify the PDF in that way.
Do you need to flatten the file or do you just need to prevent changing the filled in data at some point when the user determines that they are done filling it. You don't want to attach such a script to the willSave action because the user may not be done but may want to save their work... at least not without prompting.
If you don't need to actually flatten the fields, just set them all to read-only based on some action. With the file secured, they become uneditable.
Copy link to clipboard
Copied
One method for flattening that gets around security and rights restrictions is to print the PDF to a file. Basically re-frying it, which while not recommended for best quality, will do the trick.
Copy link to clipboard
Copied
This is an old post, but I wanted to follow up or acrchival purposes for anyone else coming across this since I've gotten this to work. This is without using flattenPages(), though I can't make much more sense of it anymore since it's been so long. Hope it helps. 🙂
Button action:
Copy link to clipboard
Copied
It's very easy to get around that. You can change the fields back to being editable, or even just edit their contents directly using a script or importing a data file, even if they are set as "read-only".
Copy link to clipboard
Copied
I'm sorry can you please clairfy, get around what?