3 Replies Latest reply on Sep 15, 2008 11:04 AM by Patrick Leckey

    HTML to Acrobat Reader Communication?

      Id like to have html to Acrobat Reader communication (and vice versa). Im able to add a messageHandler to the hostContainer within Acrobat Professional to respond to messages posted via JS on the client. I'm then able to extended the forms with liveCycle reader extensions so that the fucntionality works with Acrobat Reader. I have a few questions/issues:

      1) Is this the best approch for accomplishing the task above?

      2) What is the best way to communicate in the other direction - from Reader to the client?

      3) I'm not able to add the same AcroJS to a form that I create w/ LiveCycle Designer. I add the functionality then extend the form, but the function never gets executed. Is this possible w/ LC?

      4) I also need to post the form for data collection, so I was looking into LC designer so that I can post via a webservice. Is this the best approch or should I just stick with Acrobat Pro and simply use this.submitForm to post, or is there a better alternative?

      Sorry to jam so many questions into this post, but I'm not clear on which product I should be using (Pro or LC) or which approch is considered best practice.

      Thanks,

      Matt
        • 1. Re: HTML to Acrobat Reader Communication?
          Patrick Leckey Level 3
          > 1) Is this the best approch for accomplishing the task above?

          Yes.

          > 2) What is the best way to communicate in the other direction - from Reader to the client?

          Read the postMessage documentation, especially regarding the document requirement to be disclosed.

          > 3) I'm not able to add the same AcroJS to a form that I create w/ LiveCycle Designer. I add the functionality then extend the form, but the function never gets executed. Is this possible w/ LC?

          Where are you adding the code in your XFA form?

          > 4) I also need to post the form for data collection, so I was looking into LC designer so that I can post via a webservice. Is this the best approch or should I just stick with Acrobat Pro and simply use this.submitForm to post, or is there a better alternative?

          Read the API reference regarding the SOAP object. This works in both AcroForms and XFA forms and is your most versatile option for communicating with webservices. This will still require the form be Reader Extended is the target audience only has Reader.
          • 2. Re: HTML to Acrobat Reader Communication?
            Level 1
            Thanks for the quick response PDL!

            Where are you adding the code in your XFA form?

            I right-clicked on topmostSubForm and chose "insert script object" then added it there.

            Could you send me a link to the 2 documents you mentioned?
            1) postMessage
            2) API reference regarding the SOAP object

            The target audience that will be using these forms will only have Reader. The forms have a lot of static data that needs to be collected. And I need to communicate back and forth b/t the client app and Reader at run time. In your opinion should I be using AcroForms or XFA forms?
            • 3. Re: HTML to Acrobat Reader Communication?
              Patrick Leckey Level 3
              > I right-clicked on topmostSubForm and chose "insert script object" then added it there.

              Ah, that's probably why it's not running. On topmostSubForm, put your script in the docReady event and then try it.

              > Could you send me a link to the 2 documents you mentioned?

              Actually it's the same document, the JavaScript for Acrobat API Reference. To get to it, go here:

              http://www.adobe.com/devnet/acrobat/
              Click on "Acrobat 9 SDK Documentation is available online and for offline use"

              From the left nav panel choose the following:
              JavaScript > JavaScript for Acrobat API Reference > JavaScript API

              This is where you will find the JS API broken down by object. postMessage is under the "Embedded PDF" section and SOAP has its own section, aptly titled "SOAP". The SOAP section has a good number of examples to get you started. I suggest starting with the example in SOAP.connect().