How to communicate with adobe pdf object element using javascript

Recently, i have found a problem, that I need to customize displaying embedded PDF on a HTML page and communicate with it.When it goes to HTML embedded pdf object, common practise is to use following snipped:

<object data="c:\\a\\AppArchGuide2.0.pdf" type="application/pdf" width="300" height="200" name="ad">

Is there a possibility to change inner parameters of that html object ? The easiest are html exposed properties like with and height which object reacts good. But changing data attribute does not load a new document. You need to change document directly in embedded activex object. Embedded Acrobad Reader is following object AcroPDFLib.IAcroAXDocShim.

Creating object programmatically (from a thick client) is a bit of trouble, due to Adobe licensing limitations (you cannot do that). But using created embedded html object is with no problem. In embedded object there is object property of desired iacroaxdocshim type.

Here is a screen of "object" property tree structure in IE8 dev. tools


Properties under this tree are fine to change and embedded control react on them well. For example, change a document after page was loaded is this line:

ad.object.src = '';

where ad is name of embedded element. For example, for loading document without bookmarks etc.. is with


Example file for download:


A version of library for delphi

Adobe Acrobat SDK EULA (SDK contains headers and docs)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s