Copy link to clipboard
Copied
We are using the flatten fields and comment java script, but it doesn't lock the comment fields. Does anyone have the code to lock all comments so we don't have to do manually? We are using Acrobat Pro X.
Copy link to clipboard
Copied
I'm probably missing something, but my view of "flattening" comments is to turn them into page contents so there are no longer any comments. Given that, there's nothing to lock afterwards. What JavaScript do you use?
Copy link to clipboard
Copied
We are using the Flatten Fields and Comments and this is the javascript within it:
event.target.flattenPages();
Copy link to clipboard
Copied
That script used in an action will flatten all fields and comments into regular page contents. Are you saying that it is not flattening any of the comments, just some of the comments, or something else?
Copy link to clipboard
Copied
It is not flattening the comments because the comments can still be deleted. I ran the script, saved the file and re-opened it. The comments were delete-able. If I manually lock the comments before the script, the comments cannot be deleted.
Copy link to clipboard
Copied
Hmm, as described there won't be any annotations: "All annotations—including form fields, comments, and links—on the specified range of pages are flattened. They may have appearances, but they will no longer be annotations."
Do you see something different?
Copy link to clipboard
Copied
It is not flattening the comments because the comments can still be deleted. I ran the script, saved the file and re-opened it. The comments were delete-able. If I manually lock the comments before the script, the comments cannot be deleted.
Copy link to clipboard
Copied
What tool are you using to delete these "comments" after you flatten the file?
Copy link to clipboard
Copied
You can just right-click and delete them in Adobe.
Copy link to clipboard
Copied
After you run the action, open the JavaScript console by pressing Ctrl+J to see if any errors are reported.
Copy link to clipboard
Copied
This is a file from an architect who has signed and sealed it (which is how all of them will be) so not sure if this is why I got this when I pressed Ctrl + J...
Version 10.0
Acrobat SOAP 10.0
NotAllowedError: Security settings prevent access to this property or method.
Doc.flattenPages:1:Batch undefined:Exec
Copy link to clipboard
Copied
You have your answer. You're not allowed to flatten the file due to the security restrictions placed on it by its author.
Copy link to clipboard
Copied
If you were to edit a signed document it would destroy the signature. So you have to work with what is signed, not edit it.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now