3 Replies Latest reply on Jan 18, 2012 8:58 AM by Dave Merchant

    Adobe Javascript Limitations

    zligong2012

      Dear Adobe support,

       

      Can you tell me some limitations about Adobe Javascript compare with HTML JavaScript?

       

      Currently we have some web page forms written in JSP with very simple Java but very complicated JavaScript code. I wonder if it is possible to replace them using Adobe interactive forms instead.

       

      I took a quick look at your online manual and it looks like it can do a lot things like HTML JavaScript. But is there anything that can be done using HTML Javascript but not Adobe JavaScript?

       

       

      Thanks,

       

       

      Ligong

        • 1. Re: Adobe Javascript Limitations
          try67 MVP & Adobe Community Professional

          This is not Adobe Support, it's a User-to-User forum.

           

          There are many differences between what can be done with HTML JS and

          Acrobat JS, although the core syntax is the same.

          If you specify what exactly you want to achieve, you might get a more

          concrete answer to your question.

          • 2. Re: Adobe Javascript Limitations
            zligong2012 Level 1

            Thanks a lot for your reply.

             

            Can you give me some examples that things can not be done using Acrobat JS?

             

            We need to do things like event handling, field creation/modification, change format/layout and data upload back to a server, all at run time.

             

            Thanks again,

             

             

            Ligong

            • 3. Re: Adobe Javascript Limitations
              Dave Merchant MVP & Adobe Community Professional

              Event handling - yes, you can react to things like form submit, mouseover/up/down, etc.

               

              Field creation/modification - you can make some changes (e.g. making a field read-only) but you cannot create new fields dynamically in Reader.

               

              Change format/layout - you cannot reformat the contents of a PDF page with embedded JS. Dynamic, reflowable forms are possible in XFA (with LiveCycle Designer) but not in Acrobat.

               

              Data upload - you can submit a form to a URL and parse the response, provided the response is in the right format (FDF). Outside of the submit event, scripts cannot communicate outside the document - so for example you can't use AJAX-style handlers.

               

              The primary difference between HTML JS and AcroJS is that in Acrobat we have no DOM. All the typical things you'd do on a website like element selectors are absent, you can't use things like jquery, there's no access to the page content (only to annotations), and you're running in a document-level sandbox.

               

               

              If you can write HTML JS, then you can write AcroJS - but apart from generalized functions, you can't use any of the same code. Whatever your website does, you'll have to start from scratch if you want to replicate it within a PDF form.

               

              zligong2012 wrote:

               

              Thanks a lot for your reply.

               

              Can you give me some examples that things can not be done using Acrobat JS?

               

              We need to do things like event handling, field creation/modification, change format/layout and data upload back to a server, all at run time.

               

              Thanks again,

               

               

              Ligong