These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

HTML JavaScript <--> PDF JavaScript communication

wisi
Registered: Dec 18 2008
Posts: 9
Answered

Hi,
I know that it's possible to send data from HTML-JavaScript to PDF-JavaScript via postMessage(). But is ist also possible to get any feedback from the PDF in HTML-JavaScript?
I need some data from the PDF in the HTML-JavaScript to evaluate, wheather something went wrong or not.

Thanks for your answer.

My Product Information:
LiveCycle Designer, Windows
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
The AcroJS HostContainer.postMessage() method pushes a message back to the HTML JS the same way - but your HTML JS needs to define a message handler to collect it. The SDK help file is dead on this method but there's a vague sample here:-

http://support.adobe.com/devsup/devsup.nsf/docs/54352.htm

(didn't say it was easy to understand though, and it'll crash some instances of Firefox)
wisi
Registered: Dec 18 2008
Posts: 9
Thank you!!
This was exactly what I'm looking for. It works great.