"Restrict Editing"-like option that works with flattenPages()?

New Here ,
May 29, 2019

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.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

112

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

"Restrict Editing"-like option that works with flattenPages()?

New Here ,
May 29, 2019

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.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

113

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 29, 2019 0
Adobe Community Professional ,
Jun 03, 2019

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.    

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 03, 2019 0
Adobe Community Professional ,
Jun 05, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 05, 2019 0