Copy link to clipboard
Copied
I am trying to create a form that can be flattened via a form button.
I have created a pdf that needs to be sent out to resellers and requires an address and logo change.
I set up as a form and all works well but I wanted the reseller to be able to save the updated PDF as a flattened PDF instead of a filled form. Most of the resellers don't have the Adobe suite so I created an action to flatten the pdf whilst retaining the data and I was hoping to be able to use that action within a form (i.e. click the button and the pdf is flattened).
Is this possible or am I dreaming?
Copy link to clipboard
Copied
You can use the Javascript this.flattenPages();
This will work in Acrobat Standard and Pro.
Copy link to clipboard
Copied
Thanks. I read that elsewhere and it didn't work but maybe I'm doing it wrong.
I've set up a button at the end of the document, after the address has been updated and the logo uploaded, and that button has the following actions: On mouse up Run a JavaScript [this.flattenPages();] | Execute a menu item [File>Save As]
So when the button is pushed I was expecting the form to flatten but hold the info and then to save as. When I ran the action the pdf saved as but hadn't flattened.
Later.... I've been testing this and have it working on Acrobat Pro DC but keep getting the " NotAllowedError: Security settings prevent access to this property or method." error on Acrobat Reader. I've checked the security settings and it's all clear.
Copy link to clipboard
Copied
Acrobat Reader can't flatten pages!
Copy link to clipboard
Copied
Ah ok, thanks for your help. I will have to look for another solution then.
Copy link to clipboard
Copied
With Reader your options are:
- Set all fields as read-only
- Add a Digital Signature to the field and set it to lock all fields when signed.
The former is easier to do, but much less secure. The latter requires the user to actually sign the file for the fields to become locked.