Copy link to clipboard
Copied
Hello, I have problem with PrintJob - printing to pdf.
I want print some bitmaps with transparency and vectors.
I checked all options and still have grey background under bitmaps and vectors. This is stage background color.
var pj:PrintJob = new PrintJob();
var sheets:MovieClip;// = new Sprite();
var options:PrintJobOptions = new PrintJobOptions();
options.printAsBitmap = false;
var dodd:MovieClip = new MovieClip();
stage.addChild(dodd);
var pagesToPrint:uint = 0;
if (pj.start()) {
for (var i:int = 0; i < pages.length; i++)
{
sheets = new MovieClip();
//sheets.graphics.beginFill(0xFF0000, 0);
//sheets.graphics.beginBitmapFill(pages.getChildAt(0).bitmapData, null, false, true);
/*sheets.graphics.lineStyle(0,0,0);
sheets.graphics.drawRect(0, 0, pj.pageWidth, pj.pageHeight);
sheets.graphics.endFill();*/
sheets.addChild(pages);
dodd.addChild(sheets);
try {
pj.addPage(sheets, new Rectangle(0, 0, pj.pageWidth, pj.pageHeight) , options);
pagesToPrint++;
}
catch(e:Error) {
// do nothing
}
}
if(pagesToPrint > 0) {
pj.send();
}
while(dodd.numChildren>0){
dodd.removeChildAt(0);
}
stage.removeChild(dodd);
dodd = null;
}
using actionscript, create new 'pages' with a white background and the content you want and then print those new pages.
Copy link to clipboard
Copied
using actionscript, create new 'pages' with a white background and the content you want and then print those new pages.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now