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

PDF Open Parameter functionality without reload of PDF file?

dougcooper
Registered: Jun 26 2010
Posts: 5
Answered

Greetings. I can use PDF Open Parameters just fine to open a
PDF (in a browser frame or embed ) to the proper page and position.

Once the PDF has been opened, is there any non-ActiveX way
(i.e. from Chrome/Firefox), using Javascript from a different frame,
to change the current page or position without reloading the PDF?

Many thanks in advance for any definitive answer.
Doug

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can put navigation buttons inside the PDF, but if you are talking about controls on the HTML page that perform the navigation, your only choices are using the ActiveX controls or forcing a reload of the PDF into the frame. You aught to be able to force the reload by manipulating the innerHTML of the frame, but this is not a very efficient operation. You'll probably need to turn off caching of the PDF.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

dougcooper
Registered: Jun 26 2010
Posts: 5
Many thanks for your response. I gather that I can't load the
PDF "search" window from outside the document, even if the
PDF file is in a frame.

However, can I define a Javascipt function within the PDF
file that can load the search window, then expose that function
to (and send it arguments from) the parent browser environment?
(Same goes for "find next.") This would avoid the problem of
reloading the PDF file.

Thanks,
Doug
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can pass parameters to the PDF in the URL using a query string format. The URL is accessible to scripts inside the PDF through the "doc.URL" property. All the srcript has to do is parse it. Use a document level script. But there is also "search" Open Parmerter that will open the search window. I don't know if it will work in the browser. The PDF might need to be opened in the stand alone Acrobat. Try it and see.

To do it dynamically, yes,you can use the HostContainer object to setup a communication channel between Acrobat JavaScript and the HTML JavaScript. Here's an example:
http://www.windjack.com/WindJack/Browser2PDF/brwsr2acroJS.htm

This one could have been setup better, but the Frames and the PDF show what can be done.

You'll find another example in the Acrobat 8 SDK samples

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script