PrintJob.addPage() 597
The coordinates you specify for printArea represent screen pixels relative to the registration
point of the
_root movie (if target = 0) or of the level or movie clip specified by target. You
must provide all four coordinates. The width (
xMax-xMin) and height (yMax-yMin) must each be
greater than 0.
Points are print units of measurement, and pixels are screen units of measurement; one point is
equal in size to one pixel. You can use the following equivalencies to convert inches or centimeters
to twips, pixels or points (a twip is 1/20 of a pixel):
• 1 pixel = 1 point = 1/72 inch = 20 twips
• 1 inch = 72 pixels = 72 points = 1440 twips
• 1 cm = 567 twips
Note: If you have previously used print(), printAsBitmap(), printAsBitmapNum(), or printNum() to
print from Flash, you used a
#b frame label to specify the area to print. When using the addPage()
method, you must use the
printArea parameter to specify the print area; #b frame labels are ignored.
If you omit the printArea parameter, or if it is passed incorrectly, the full Stage area of target is
printed. If you don’t want to specify a value for
printArea but want to specify a value for
options or frameNumber, pass null for printArea.
options An optional parameter that specifies whether to print as vector or bitmap, in the
following format:
{printAsBitmap:Boolean}
By default, pages are printed in vector format. To print target as a bitmap, pass true for
printAsBitmap. The default value is false, which represents a request for vector printing. Keep
in mind the following suggestions when determining which value to use:
• If the content that you’re printing includes a bitmap image, use {printAsBitmap:true} to
include any transparency and color effects.
• If the content does not include bitmap images, omit this parameter or use
{printAsBitmap:false} to print the content in higher quality vector format.
If
options is omitted or passed incorrectly, vector printing is implemented. If you don’t want to
specify a value for
options but want to specify a value for frameNumber, pass null for options.
frameNumber An optional number that lets you specify which frame to print; notice that any
ActionScript on the frame is not invoked. If you omit this parameter, the current frame in
target
is printed.
Note: If you previously used print(), printAsBitmap(), printAsBitmapNum(), or printNum() to print
from Flash, you may have used a
#p frame label on multiple frames to specify which pages to print. To
use
PrintJob.addPage() to print multiple frames, you must issue a PrintJob.addPage() command for
each frame;
#p frame labels are ignored. For one way to do this programmatically, see the example
later in this entry.
Returns
A Boolean value of true if the page was successfully sent to the print spooler, false otherwise.
Description
Method; sends the specified level or movie clip as a single page to the print spooler. Before using
this method, you must use PrintJob.start(); after calling PrintJob.addPage() one or more
times for a print job, you must use
PrintJob.send() to send the spooled pages to the printer.