8
Working with Digital Media in PDF Documents
Monitors
In addition to the capabilities within the
Monitors
object, the
Monitor
object provides
the properties shown below in
Table 8.4:
T
ABLE
8.4
Monitor Object Properties
Property
Description
The color depth of the monitor in bits per pixel
Returns
true
if the monitor is the primary one
The boundaries of the monitor in virtual desktop
coordinates
The monitor’s workspace boundaries in virtual desktop
coordinates
colorDepth
isPrimary
rect
workRect
The example below illustrates how to obtain the primary monitor and check its color depth:
var monitors = app.monitors.primary();
if (monitors.length > 0)
console.println("Color depth: " + monitors[0].colorDepth);
The next example llustrates how to obtain the monitor with the greatest color depth, with a
minimum specified depth of 32:
var monitors = app.monitors.bestColor(32);
if (monitors.length > 0)
console.println("Found the best color depth over 32!");
The next example llustrates how to obtain the monitor with the greatest width in pixels,
and determines whether it is the primary monitor:
var monitors = app.monitors.widest();
var isIsNot = (monitors[0].isPrimary) ? " is " : " is not ";
console.println("Widest monitor" + isIsNot + "the primary.");
150
Acrobat JavaScript Scripting Guide