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

script needed to set "single page continuous" when file is opened

rbogie
Registered: Apr 28 2008
Posts: 432
Answered

can anyone suggest a script that will set page layout (display) to "single page continuous" when a file is opened (aside from setting an action at every single page of the file). Such a script would address an apparent "bug" in Reader 9 wherein Reader 9 ignores the author's "single page continuous" setting at document properties> initial view.

re "bug" in Reader 9, see this post
http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=23140

My Product Information:
Acrobat Pro 8.1.5, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "doc.layout" property controls the page view (See the JS Ref). The best place to put this code is the Open Action on Page 1.

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

rbogie
Registered: Apr 28 2008
Posts: 432
thanks for responding. the rub is that a file where "single page continuous" is essential will usually be opened by the user/reader via a hyperlink from another document; the hyperlink will typically point to a named destination that opens a page other than page #1. (fn: if the document is always opened to page #1, the issue is easily solved by placing an appropriate menu item action on page #1) but, where the document may be opened to a page other than page #1, the solution seems to be in a global (when file opens) action. is there such a global script (or action) that will execute whan a file is opened, regardless of the page that opens first?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can place the code in a Document Level Script from the "Advanced > Document Processing Document JavaScripts..." menu item. This script is run as soon as the PDF is opened. It should work just find. I like to put code that modifies the document, or view, into the page action script because the document is not guarenteed to be fully loaded and displayed when the document level scripts are run. So there are some situations where the code doesn't do its job because the document resources simply aren't there yet.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

rbogie
Registered: Apr 28 2008
Posts: 432
and thanks for the response to this one, too
http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=23240