Acrobat 9 Pro, Windows XP
The code below was pasted into the Document Script area. It works only when Acrobat is already opened and a file containing this code is opened using File>Open.
But if the file is double-clicked (and therefore opened) the code does not seem to execute.
Tried moving the below code to Page 1 but again it only works if Acrobat is already opened and then using File-Open to load the file.
Many Thanks.
// get object representing the primary monitor
var monitors = app.monitors.primary();
// returns an array that represents the monitor's boundaries
var res = monitors[0].rect;
// check if resolution is higher than 800x600
if(res[2] > 800 && res[3] > 600)
{
// set document zoom to 100%
this.zoom = 100;
}
else
{
// set document zoom to 65%
this.zoom = 65;
}
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