« Printing Comments in Adobe Acrobat | Main | Remove Comments from a PDF »

Flatten Comments in a PDF

I recently attended the Acrobat Users Group meeting in Dallas.  This month our guest speaker was Lori DeFurio who is the Customer and Field Enablement Evangelist for Adobe primarily focused on Acrobat.  Lori has probably forgotten more about Acrobat than I will ever know.  It was a great presentation and she showed a bunch of tips and tricks to be used with Acrobat.  One of the tips was how to flatten all comments, forms, and digital signatures on a pdf so they could no longer be edited, moved, deleted and so forth.  In this blog entry I will show you how.


In the AEC/EPC industry we go through very strict review and commenting processes that lead up to versions or revisions of a document.  Where this feature is useful is at the end of a review you can simply flatten all the comments, form fields, or digital signatures in the pdf.  This way they can longer be edited, moved or deleted.  Very important – there is no “undo” that I have found after you save the file.  In most cases I would keep the original so that you have the history of what took place.  Also when you use this feature, it is going to minimize all pop-ups.  You have been warned; and in other words test before you use.

 

How do you do it?  Let’s say that I have completed the review on the document below:

 

 

 

There is not a menu command that you can execute to flatten all the comments.  So the trick is you have to use a Javascript!  Okay, before I lose you since I mentioned a “javascript”, just note that I am a novice when it comes to programming.  In fact, I have not done any programming since my Fortran days in college.  I am going to give you the code you just have to cut and past it into the Java Script debugger.

 

Step 1:  Hit Ctrl-J on your keyboard.  This brings up the JavaScript debugger as seen below.

 

 

Delete all the text that is listed in the Console Screen.  Then simply type the following command in the blank window.

 

this.flattenPages()

 

 

 

I must warn you again before you execute this script.  If you "save" the file after you execute the script there is no “undo” and the pop-ups will be collapsed!

 

To execute this JavaScript all you have to do is hit Ctrl-Enter on your keyboard.  The cursor must be on the same line or you can highlight the text.

 

You will now notice that you cannot edit, move, delete or change any of the comments, form fields or digital signatures that where originally placed on the document.

 

There is a second option, and that is to download a free plug-in from our friends at Wind Jack Solutions.  Then you just simply drag the javascript file provided into the JavaScript folder under the Acrobat install on your computer.  On my computer it is c://programfiles/adobe/acrobat 8/acrobat/javascript.  After you drag and drop the code into the folder and launch Acrobat the button will look like this. (Flatten Pages icon below)

 

 

 

Thom Parker who is the president of Wind Jack, also has a blog on AcrobatUsers.com and manages the JavaScript Corner as well.  If you want more JavaScript tips and trick check out the links above.  Also, for even more development resources, be sure and check out Joel Geraci’s developer blog.  It has a lot of great content as well.

 

Have Fun,

 

Jonathan


Comments

Thank you so much for posting this! It worked like a charm (the first example is what I used)

Jonathan Reply: Glad you liked it. Have a great day.

Wow! Thank you SO much! It has been driving me nuts not being able to flatten PDFs. I have to add in headers, footers, and misc. other items when I make an appendix or the like for our clients. Then I always have to tell our printing company to make sure to print "document and markups." The techniques you provided will make it possible to ensure that my documents get printed properly and save me all the time and aggravation! Thank you again!

Jonathan Writes: Glad I could help

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)