10 Replies Latest reply on Jun 30, 2011 1:48 PM by Neil-Kentucky

    Flattening on X Standard?


      I recently upgraded to Adobe X Standard and cannot find a quick way to flatten files.

      Previously in 8 and 9 I had used the javascript approach: http://blogs.adobe.com/acrolaw/2010/02/add-a-flatten-document-menu-item-to-acrobat/.

      When I purchased X, I thought I would be able to used the Action Wizard, but did not realize it Standard does not support the Action Wizard: http://acrobatusers.com/content/flatten-fields-and-comments.


      Is there any way to easily flatten on X Standard (other than printing)?  Is a java script available for X that I simply haven't found?  Or do I need to upgrade to X Pro?  Thanks.

        • 1. Re: Flattening on X Standard?
          George_Johnson MVP & Adobe Community Professional

          Did you copy the folder JavaScript file to the new installation? If so, it may need to be editied depending on which menu item it used, since a lot of them were removed with Acrobat 10.


          As a test with a copy of a document, try opening the interactive JavaScript console (Ctrl+J) and enter the following line of code:




          Click on the line or highlight it, and press Ctrl+Enter. This should execute the code and flatten all pages in the document. If it gives an error, post again and include exactly what it says.

          • 2. Re: Flattening on X Standard?
            BTW37 Level 1

            For some reason my interactive javascript consule is not appearing.  CTRL J isn't bringing anything up.  I did copy the script for 8 and 9 into my X Program File prior to the first post and have not had any results.

            • 3. Re: Flattening on X Standard?
              Bernd Alheit Adobe Community Professional & MVP

              Use this:

              function Flatten(boolCurrentPageOnly) // Takes a boolean argument
                var i
                // Give them a chance to back out
                i = app.alert("Are you sure you want to do this?", 1, 2)
                if (i != 3) { // If they didn’t click "No"...
                  if (boolCurrentPageOnly) // Flatten either this page...
                    this.flattenPages() // ...or all pages

              cName: "Flatten current page",
              cParent: "File",
              cExec: "Flatten(true)"});
              cName: "Flatten all pages",
              cParent: "File",
              cExec: "Flatten(false)"});

              • 4. Re: Flattening on X Standard?
                George_Johnson MVP & Adobe Community Professional

                I don't have Standard 10 to test this with, but see if you've enabled the console by checking "Edit > Preferences > JavaScript". Here's what Acrobat 9 Pro looks like (in part):




                Does the menu item get created by the code in the folder-level JavaScript get displayed? If not, can you post again with the exact location of the file as well as the relevant code inside it?

                • 5. Re: Flattening on X Standard?
                  BTW37 Level 1

                  In Adobe 10, the interactive javascript control option is not available through Preferences (or anywhere else that I can find).  I insert an open console script into my adobe file (C: Program files\Adobe\Acrobat 10.1\Acrobat\Javascripts) and the console does now open, when I start Adobe.  However, both the javascript for 8 and 9, and Berndt's new script show errors when I run them.  To run, I insert the script into the Tools-JavaScript-Set Document Actions-Document Did Save.  The error message I recieve is:

                  Acrobat EScript Built-in Functions Version 10.0
                  Acrobat SOAP 10.0


                  TypeError: redeclaration of const Flatten
                  2:Doc:Did Save

                  • 6. Re: Flattening on X Standard?
                    gkaiseril MVP & Adobe Community Professional

                    You might want to look at Free Acrobat Automation Tools at PDFScripitng.com.


                    You also might want to look over Entering Folder Level Scripts by Thom Parker to learn how to install application folder level scripts.

                    • 7. Re: Flattening on X Standard?
                      BTW37 Level 1

                      Thanks GK.  The Automation Tools fixed the problem.  I simply downloaded the files listed under "Flatten Page Content Tool", and pasted the three files into my Adobe javascript file.  Thank you.


                      • 8. Re: Flattening on X Standard?
                        BTW37 Level 1

                        I stand mistaken.  The Flatten Page Content Tool does compress the layers into 1, but it allows for editing.  Once the page is flattened, I can use the "Edit Document Text" feature in X to edit the document.  Other than using Security, is there a program to flatten the layers, and provide uneditable flattened layers?

                        • 9. Re: Flattening on X Standard?
                          Dave Merchant MVP & Adobe Community Professional

                          Unless the file is secured or converted into a series of full-page images, it will *always* be editable in Acrobat. That's why people buy Acrobat.


                          Flattening converts annotations into page content, so it becomes just like the rest of the text. It has no effect on optional content groups (OCG, also known as layers) - that's an entirely different thing. You can merge OGCs using the tools on the Layers Navigator tab, or use Sanitize Document to flatten and merge everything that's visible, but it will STILL be editable.

                          • 10. Re: Flattening on X Standard?
                            Neil-Kentucky Level 1

                            Is there a fax way to convert the open document to an PDF Image? I have the same issue as the post creator has.  I actually sign documents using stamps and then print to Adobe PDF printer, go into advanced, and choose "print as image".  This is annoying to change back and forth. 


                            If there were a way to use a button that always printed to PDF as an image, it would save me a lot of time and keep my signatures safe.  Do you know how to do this?