5 Replies Latest reply on Dec 18, 2010 12:20 PM by gkaiseril

    How do I list all document-level Javascripts?

    wildcathoya

      We process 3rd party PDFs and we want to make sure that they contain no document-level Javascripts.  Is there any way to get a complete list of all document-level Javascripts?  The Javascript API has a "removeScript" method, but it requires the name of the script, which, of course, we don't know in advance.  I also checked the IAC and plug-in documentation but found nothing.

       

      There must be a way to do this in Acrobat because the "Advanced>>Document Processing>>Document Javascripts" menu item opens a dialog that lists all of Javascript funtions.

       

      Thanks,

       

      Bill

        • 1. Re: How do I list all document-level Javascripts?
          Bernd Alheit Adobe Community Professional & MVP

          There must be a way to do this in Acrobat because the "Advanced>>Document Processing>>Document Javascripts" menu item opens a dialog that lists all of Javascript funtions.

          You can write a plugin for this.

          • 2. Re: How do I list all document-level Javascripts?
            wildcathoya Level 1

            COSDict, or something else?

            • 3. Re: How do I list all document-level Javascripts?
              Bernd Alheit Adobe Community Professional & MVP

              Don't know how you can access this. Document-level JavaScript and Document Actions are stored at several places.

              • 4. Re: How do I list all document-level Javascripts?
                FrancisFukuyama

                What exactly are document level scripts and what are the other levels of the scripts and how to write this plugin ? what doc to read for this ?

                • 5. Re: How do I list all document-level Javascripts?
                  gkaiseril MVP & Adobe Community Professional

                  They are not plug-ins. Plug-ins are pieces of code written in a computing languages other than Acrobat JavaScirpt, and must be installed in a very specific folder on each local machine, the plugin folder. These programs can access features not available to Acrobat JavaScirpt or can access the Acrobat JavaScript object.

                   

                  Within a PDF scripts can reside within a field and be triggered by a mouse action, entering or leaving a field, check keystrokes, format input, validate input, or calculate a value. JavaSdirpts can be executed also be executed by bookmarks. There are page actions  (open close), print actions (will print and did print), and save actions (will save and did save). There are also scripts that are run or made available upon opening a PDF, document level JavaScripts. These scripts may create special user defined functions (callable and reusable code) and make them available to other actions within the PDF or they can create the environmental variables and expected stat of the PDF. There are also application level JavaScripts that are run when either Acrobat or Reader is opened. These are special files located in a unique location and consist of Acrobat JavaScript code.

                   

                  All Acrobat JavaScript is plain text the is read and tokinized by the Acrobat JavaScript interpreter. The created tokens are stored in memory and processed as needed the by action being preformed.

                   

                  Acrobat JavaScrpt is similar to macros within an MS Office document.