Setting Size, Scale, And Orientation - Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual

Programming actionscript 3.0
Table of Contents

Advertisement

Setting size, scale, and orientation

The section
"Printing a page" on page 488
output directly reflects the printed equivalent of the screen size and position of the specified
sprite. However, printers use different resolutions for printing, and can have settings that
adversely affect the appearance of the printed sprite.
Flash Player can read an operating system's printing settings, but note that these properties are
read-only: although you can respond to their values, you can't set them. So, for example, you
can find out the printer's page size setting and adjust your content to fit the size. You can also
determine a printer's margin settings and page orientation. To respond to the printer settings,
you may need to specify a print area, adjust for the difference between a screen's resolution
and a printer's point measurements, or transform your content to meet the size or orientation
settings of the user's printer.
Using rectangles for the print area
The
PrintJob.addPage()
printed. The second parameter,
three options for providing a value for this parameter:
Create a Rectangle object with specific properties and then use that rectangle in the
call, as in the following example:
addPage()
private var rect1:Rectangle = new Rectangle(0,0,400,200);
myPrintJob.addPage(sheet, rect1);
If you haven't already specified a Rectangle object, you can do it within the call itself, as in
the following example:
myPrintJob.addPage(sheet, new Rectangle(0, 0, 100, 100));
If you plan to provide values for the third parameter in the
to specify a rectangle, you can use
myPrintJob.addPage(sheet, null, options);
If you plan to specify a rectangle for the printing dimensions, remember to import the
flash.display.Rectangle
details the steps for a basic print job, where the
method allows you to specify the region of a sprite that you want
is in the form of a Rectangle object. You have
printArea,
for the second parameter, as in the following;
null
class.
call, but don't want
addPage()

Setting size, scale, and orientation

493

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents