13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 54: Printing<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

Flash runtimes (such as Adobe® Flash® Player and Adobe® AIR) can communicate with an operating system’s printing<br />

interface so that you can pass pages to the print spooler. Each page s<strong>en</strong>t to the spooler can contain cont<strong>en</strong>t that is<br />

visible, dynamic, or off scre<strong>en</strong> to the user, including database values and dynamic text. Additionally, the properties of<br />

the flash.printing.PrintJob class contain values based on a user’s printer settings, so that you can format pages<br />

appropriately.<br />

The following cont<strong>en</strong>t provides strategies for using the flash.printing.PrintJob class methods and properties to create<br />

a print job, read a user’s print settings, and adjust a print job based on feedback from a Flash runtime and the user’s<br />

operating system.<br />

Basics of printing<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

In ActionScript 3.0, you use the PrintJob class to create snapshots of display cont<strong>en</strong>t to convert to the ink-and-paper<br />

repres<strong>en</strong>tation in a printout. In some ways, setting up cont<strong>en</strong>t for printing is the same as setting it up for on-scre<strong>en</strong><br />

display—you position and size elem<strong>en</strong>ts to create the desired layout. However printing has some idiosyncrasies that<br />

make it differ<strong>en</strong>t from scre<strong>en</strong> layout. For example, printers use differ<strong>en</strong>t resolution than computer monitors; the<br />

cont<strong>en</strong>ts of a computer scre<strong>en</strong> are dynamic and can change, while printed cont<strong>en</strong>t is inher<strong>en</strong>tly static; and in planning<br />

printing, consider the constraints of fixed page size and the possibility of multipage printing.<br />

Ev<strong>en</strong> though these differ<strong>en</strong>ces seem obvious, it’s important to keep them in mind wh<strong>en</strong> setting up printing with<br />

ActionScript. Accurate printing dep<strong>en</strong>ds on a combination of the values specified by you and the characteristics of the<br />

user’s printer. The PrintJob class includes properties that allow you to determine the important characteristics of the<br />

user’s printer.<br />

Important concepts and terms<br />

The following refer<strong>en</strong>ce list contains important terms related to printing:<br />

Spooler A portion of the operating system or printer driver software that tracks the pages as they are waiting to be<br />

printed and s<strong>en</strong>ds them to the printer wh<strong>en</strong> it is available.<br />

Page ori<strong>en</strong>tation The rotation of the printed cont<strong>en</strong>t in relation to the paper—either horizontal (landscape) or vertical<br />

(portrait).<br />

Print job The page or set of pages that make up a single printout.<br />

Last updated 6/6/2012<br />

922

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!