Printjob の addPage メソッドは、最初のパラメーターとして Sprite を想定しています。
0を渡すことで何を達成しようとしていますか?
空白のページが必要な場合は、次を試してください。
var myPrintJob:PrintJob = new PrintJob();
myPrintJob.start(); /*Initiates the printing process for the operating system, calling the print dialog box for the user, and populates the read-only properties of the print job.*/
myPrintJob.addPage( new Sprite() );
myPrintJob.send();
赤い四角の別の例:
var s:Sprite = new Sprite();
s.graphics.beginFill(0xFF0000);
s.graphics.drawRect(0, 0, 80, 80);
s.graphics.endFill();
var myPrintJob:PrintJob = new PrintJob();
myPrintJob.start(); /*Initiates the printing process for the operating system, calling the print dialog box for the user, and populates the read-only properties of the print job.*/
myPrintJob.addPage( s );
myPrintJob.send();
詳細はこちら。
ステージの一部を印刷するには、次のことができます。
1) 印刷するすべてのものをスプライトでラップし、そのスプライトを addPage() に渡します。
また
2) BitmapData を使用する
var bd :BitmapData = new BitmapData(stage.width, stage.height, false);
bd.draw(stage);
var b:Bitmap = new Bitmap (bd);
var s:Sprite = new Sprite();
s.addChild(b);
var printArea = new Rectangle( 0, 0, 200, 200 ); // The area you want to crop
myPrintJob.addPage( s, printArea );