PrintJob in AS3

Basic printing in AS3:

var my_pj:PrintJob = new PrintJob();
     if (my_pj.start()) {
       try {
         my_pj.addPage([params]);
       }
       catch(e:Error) {
          // handle error 
       }
            my_pj.send();
     }

Where you replace [params] with the Sprite you want to print.

If you want to print the provided clip to the print page width, you can resize it to the right size before printing:

printClip.width = my_pj.pageWidth;
printClip.scaleY = printClip.scaleX;

http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/printing/PrintJob.html

Tech Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑