Skip to main content
Participant
August 11, 2015
Answered

Problem with PrintJob and default background

  • August 11, 2015
  • 1 reply
  • 309 views

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.

It seems to me that flash is printing in bitmap mode whatever I do.
Anybody know how print MovieClip/Bitmap without default background. I send to print bitmap/movieclip with transparency but on output is still filled bitmap.

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;

  

}

This topic has been closed for replies.
Correct answer kglad

using actionscript, create new 'pages' with a white background and the content you want and then print those new pages.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
August 11, 2015

using actionscript, create new 'pages' with a white background and the content you want and then print those new pages.