4 Replies Latest reply on Mar 19, 2010 3:15 PM by mwioncek

    JavaScript/Ecmascript from HTML

    mwioncek

      Is there any possible ways to get javascript from a webpage into an Acrobat PDF file?  Even if we can embed Ecmascript into the files and then generate them as a PDF to get the functionality we'd like would be a huge help.

        • 1. Re: JavaScript/Ecmascript from HTML
          gkaiseril MVP & Adobe Community Professional

          You can cut and paste the code, but you will need to make adjustment for Acrobat JS objects, properties, and methods.

           

          Have you downloaded the Acrobat SDK or Acrobat JavaScirpt documentation?

          • 2. Re: JavaScript/Ecmascript from HTML
            mwioncek Level 1

            I've looked at the documentation but it didn't directly address what I'm hoping to do.  I'd like to create templates that I can distribute to others for generation through a dreamweaver extension.  So that they may put in their own images into the templates and create a live website.  The site would then need to be caputred into a PDF for remote distribution as this is internal outside groups cannot access it as well as needing it for versioning of the sites.  So I'd like to have a way to auto generate the code and not have my group not need to do the scripting themselves.

             

            So if I could create the HTML with ecmascript so that when they do a create PDF from web page or something the interactivity would remain intact.

            • 3. Re: JavaScript/Ecmascript from HTML
              gkaiseril MVP & Adobe Community Professional

              If you are going to write an application to create a PDF and add JavaScirpt to the created PDF you probably should be asking the question in the Developer's forum.

               

              I have converted Web JavaScript to Acrobat JavaScript and it mostly took changing the objects from the web type object to the Acrobat object and some modification to adjust for Acrobat JS properties and methods.

              • 4. Re: JavaScript/Ecmascript from HTML
                mwioncek Level 1


                All the application would do is dump a webpage template.  I know that part.  What I'm curious on is the scripting.  I need to be able to have a show/hide on the web as well as on a PDF if I was to convert the web page over to PDF and I'd like the template to dump the code for both if possible.

                 

                I'm thinking based on your previous post that I can write the script for Adobe and put in a body onLoad event that will fire in a browser and trigger a swap to web script. Any thoughts on that?