MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 396

Actionscript language reference
Table of Contents

Advertisement

Description
Method; displays the operating system's print dialog boxes and starts spooling. The print dialog
boxes let the user change print settings. When the
successfully, the following read-only properties are populated, representing the user's print
settings:
Property
PrintJob.paperHeight
PrintJob.paperWidth
PrintJob.pageHeight
PrintJob.pageWidth
PrintJob.orientation
After the user clicks OK in the Print dialog box, the player begins spooling a print job to the
operating system. You should issue any ActionScript commands that affect the printout, and you
can use
PrintJob.addPage()
height, width, and orientation properties this method populates to format the printout.
Because the user sees information such as "Printing page 1" immediately after clicking OK, you
should call the
PrintJob.addPage()
If this method returns
operating system's Print dialog box), any subsequent calls to
PrintJob.send()
PrintJob.addPage()
sure the print spooler is cleared, as shown in the following example:
var my_pj:PrintJob = new PrintJob();
var myResult:Boolean = my_pj.start();
if(myResult) {
// addPage() and send() statements here
}
delete my_pj;
Example
The following example shows how you might use the value of the orientation property to adjust
the printout:
// create PrintJob object
var my_pj:PrintJob = new PrintJob();
// display print dialog box
if (my_pj.start()) {
// boolean to track whether addPage succeeded, change this to a counter
// if more than one call to addPage is possible
var pageAdded:Boolean = false;
396
Chapter 6: ActionScript Core Classes
Type
Number
Number
Number
Number
String
commands to send pages to the spooler. You can use the read-only
and
(for example, if the user clicks Cancel instead of OK in the
false
will fail. However, if you test for this return value and don't send
commands as a result, you should still delete the PrintJob object to make
PrintJob.start()
Units
Notes
Points
Overall paper height.
Points
Overall paper width.
Points
Height of actual printable area on the
page; any user-set margins are ignored.
Points
Width of actual printable area on the
page; any user-set margins are ignored.
N/A
"Portrait" or "landscape."
commands as soon as possible.
PrintJob.send()
PrintJob.addPage()
method returns
and

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flex

Table of Contents