Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Need help with PDF form - web page interaction. Quite urgent


Level 1

Hello everyone,

I am trying to achieve interaction between a PDF dynamic form created with LiveCycle Designer ES2 and the web page it must be displayed into.

I have a web page containing an iframe in which the PDF form is opened, and would like to be able to access javascript functions inside the web page from the PDF form, and viceversa.

Is it possible? If so, how?

Does it have to do with embedding a FormBridge object in my form?

I did, but still can't find a way to make the javascript on the form communicate with the one on the web page, neither the other way round.

The issue is quite urgent, so I'll really appreciate any help!

Thanks in advance,


2 Replies


Level 10

JavaScript in an HTML page can send a message to JavaScript in PDF content by calling the postMessage()method of the DOM object representing the PDF content.

See the Acrobat SDK JavaScript API for the hostContainer at

and a somewhat complex sample at



Level 1

Thankyou Steve,

that solved it!

By using the postMessage() method on the object that embeds the PDF in the web page and the FormBridge component on the form, I was able to send

messages from the page to the form.

I dug a bit more around postMessage, and also found out (should anyone need this for further reference) that communication in the opposite direction (from the form to the web page) can be achieved by calling the postMethod inside the form on the object.

So, inside your PDF form, you could for example have javascript code like this:"Hello World!");

The web page must in this case contain javascript code suitable for message handling. In particular, an event handler must be implemented for the <object> element embedding the PDF. Supposing this object has "PDFObj" as Id, the message handler code could be as follows:

function SetMessageHandler()


var PDFObject = document.getElementById("PDFObj");

    PDFObject.messageHandler =


      onMessage: function(aMessage)




          return true;


      onError: function(error, aMessage)






...and on your <body> tag something like:

<body onload="setTimeout(SetMessageHandler, 1)">

Thanks again for the help!