Adding pages to a print job

You add pages to your print job with the ActionScript 2.0 PrintJob.addPage() method. Although the method can include as many as four parameters, the only required parameter is target/level. The three optional parameters are printArea, options, and frameNum.

If you are not using a particular optional parameter but are using other optional parameters, use NULL in place of the excluded optional parameter.

With all four parameters, the function uses the following syntax:

MyPrintJob.addPage(target[,printArea:Object, options:Object, frameNum:Number]):boolean;

If you provide an invalid parameter, the print job uses default parameter values.

Each call to add a new page is unique, which lets you modify parameters without affecting previously set parameters. For example, you can specify that one page print as a bitmap image and another page print as a vector graphic. You can add as many new pages to your print job as the print job requires. One call to add a page equals one printed page.

Note: Any ActionScript code that needs to be called to change a resulting printout must run before the PrintJob.addPage() method is called. The ActionScript can, however, run before or after a new PrintJob()method. If a frame has a call to PrintJob.addPage(), the call itself does not guarantee that the ActionScript script on that frame will run when that frame is printed.

Note: For information on printing from SWF files at runtime using ActionScript 3.0, see “Printing” in Programming ActionScript 3.0.

  This page on the Web