User Guide

Flash Player tasks and system printing 491
If Flash Player encounters a problem sending the print job to the printer (for example, if the
printer is offline), you can catch that exception, too, and provide the user (or Flash Player)
with information or more options (such as displaying message text or providing an alert
within the Flash animation). For example, you can assign new text to a text field in an
if..else statement, as the following code shows:
if (myPrintJob.start())
{
try
{
myPrintJob.addPage([params]);
}
catch (e:Error)
{
// Handle error.
}
myPrintJob.send();
}
else
{
myAlert.text = "Print job canceled";
}
For a working example, see “Example: Scaling, cropping, and responding” on page 498.
Working with page properties
Once the user clicks OK in Print dialog box and PrintJob.start() returns true, you can
access the properties defined by the printers settings. These include the paper width, paper
height (
pageHeight and pageWidth), and content orientation on the paper. Because these are
printer settings, not controlled by Flash Player, you cannot alter these settings; however, you
can use them to align the content you send to the printer to match the current settings. For
more information, see “Setting size, scale, and orientation” on page 493.