Print Production
Print Production
5
Silent Printing
There are various ways to print a document without requiring user interaction. One way is
to use the
doc
object’s
print
method and set the
bSilent
attribute to
true
, as shown
in
“Printing PDF Documents” on page 79
and in the following example:
this.print({bUI: false, bSilent: true, bShrinkToFit: true});
If you would like to print without requiring user interaction, but would like to display a
progress monitor and automatically disappearing cancel dialog box, use the interactive
property as shown in the following example:
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
There are many options you may choose without requiring user interaction. For example,
you can select the paper tray:
var fv = pp.constants.flagValues;
pp.flags |= fv.setPageSize;
These coding approaches may be used in menus or buttons within a PDF file, may exist at
the folder or batch levels, and are available through Acrobat or Adobe Reader 6.0 or later.
For more information, see the
Acrobat JavaScript Scripting Reference,
as well as the Acrobat
SDK samples SDKSilentPrint.js and SDKJSSnippet1.pdf.
Printing Documents with Layers
The
printParams
object’s
printContent
property can be used to control whether
document content, form fields, and comments will be printed. In the following example,
only the form field contents will be printed (this is useful when sending data to preprinted
forms):
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.silent;
pp.printContent = pp.constants.printContent.formFieldsOnly;
this.print(pp);
Acrobat JavaScript Scripting Guide
81