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

folder level script for handling html messages

knaps
Registered: Dec 23 2009
Posts: 3

Hi,

I am researching a little bit on JavaScript embedded in the PDF files prior developing some application.

I am particularly interested in communication using JavaScript between HTML and PDF. I know that it is possible to call postMessage from HTML JavaScript to send provided message to the PDF file that can handle it and behave accordingly if some message handler has been coded in JavaScript within that PDF.

I was wondering is it possible and if yes, how, to trigger some particular behavior on PDF file from HTML page request, but with not having to embed a JavaScript into PDF file.
For example, I would like to let users visiting my website specify to which page within the PDF file they want to jump to (giving them a link that they can click on and the page would be shown).

I was thinking of having a folder level script with registered message handler on the server side (with PDF files etc.) that would then handle specific message sent from HTML JavaScript and call function to jump to that page in the PDF.
I am not sure will that work and is actually my understanding correct.

I know it is possible to jump from page to page in the PDF file by adding extra information to the URL, however I don't want to reload entire document every time, I'd like to load it once and be able to jump to any page (I think Adobe JavaScript API has got something like that) just the question is, how to synchronize it nicely with requests coming from HTML JavaScript.
I would prefer to avoid embedding JavaScript into PDF files, so I'm looking for ways how to bypass this.

Could anyone please help me clarify this issue. It is probably a bit unclear at times, so please ask, I'll try to explain it in more unambiguous way.

Thanks,
Michael

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You do realize that if you use an application folder level script, each use will need to install the script fie to their system. And since Acrobat has no installer you will have to provide an installer program or have each user perform the install manually.

You might look at using a document level script and the Soap objects.

George Kaiser

knaps
Registered: Dec 23 2009
Posts: 3
by installing, do you mean copying scripts to appropriate folders that Acrobat looks into before starting up?

Edit:
Btw. how can I access a document from the folder level script. I have app object, but calling app.activeDocs returns 0 elements even though there is a document open in Reader?