5
Print Production
Print Production
T
ABLE
5.2
Print Method Parameters
Parameter
Description
Determines whether to print each page as an image
Determines whether to print in reverse page order
Determines whether to print annotations
The
printParams
object containing the printing
settings
bPrintAsImage
bReverse
bAnnotations
printParams
In the first example below, pages 1-10 of the document are sent to the default printer, print
silently without user interaction, and are shrunk to fit the imageable area of the pages:
this.print({
bUI: false,
bSilent: true,
bShrinkToFit: true,
nStart: 1,
nEnd: 10
});
To print the document to a PostScript file, obtain the
printParams
object by invoking
the
doc
object’s
getPrintParams
method. Set its
printerName
property to the
empty string, and set its
fileName
property to a string containing the device-
independent path of the PostScript file to which it will be printed, as shown in the following
example:
var pp = this.getPrintParams();
pp.printerName = "";
pp.fileName = "/C/myPSDoc.ps";
this.print(pp);
If you would like send the file to a particular printer, you may specify the printer by setting
the
printerName
property of the
printParams
object, as shown in the following
example:
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "hp officejet d series";
this.print(pp);
80
Acrobat JavaScript Scripting Guide