Copy link to clipboard
Copied
I'm trying to flatten a pdf but retain the weblinks. When I searched online, this came up -
this.flattenPages({nNonPrint: 1});
I don't know Javascript and can't figure out how to add this to the PDF. I could really use some help here!
Copy link to clipboard
Copied
This script cannot work in Reader. You can use it in paid-for Acrobat with the JavaScript console.
Copy link to clipboard
Copied
I have the paid version - Acrobat DC Pro. Do you mean the people who print it have to have the paid version as well?
Copy link to clipboard
Copied
You can attach it to the Mouse Up event of a button and then click that button, or you could run it from the JS Console.
Copy link to clipboard
Copied
Does that work even after the PDF has been flattened (printed as PDF) ?
Copy link to clipboard
Copied
No, that's how you flatten it in the first place.
Copy link to clipboard
Copied
I don't see the connection to printing. Perhaps you can explain the problem you want to solve. Certainly anyone who runs that script needs the paid-for Acrobat.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You can set the form fields as read only.
Copy link to clipboard
Copied
I have to flatten it after the form is filled. Which means I'd have to have my employees fill in the form and then edit the PDF to read-only which isn't practical for my situation.
Copy link to clipboard
Copied
It can be done with literally a single click of a button.
Copy link to clipboard
Copied
So you don't need a paid-version or need to edit PDF to change form to READ-ONLY?
Copy link to clipboard
Copied
Nope. The free Adobe Reader can do it.
Copy link to clipboard
Copied
How do I do that? I can't seem to find the option for converting form field to READ-ONLY.
Copy link to clipboard
Copied
It requires using a script.
Copy link to clipboard
Copied
It's alright. I've been messing with adding the code much to my dismay. If I really need to work it out, I'm hoping this will work - https://turbofuture.com/computers/How-to-Change-A-PDF-Form-to-Read-Only-Before-the-User-Submits
I'm guessing this is what you meant as well. Thankyou for the response
Copy link to clipboard
Copied
This is all you need:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
f.readonly = true;
}
Copy link to clipboard
Copied
Correct.
Copy link to clipboard
Copied
Again the flow goes like
I create a form --> Employee fills form --> Employee flattens PDF --> Employee sends to clients