printAsBitmap – object must be on stage

just for future reference, I’ve discovered today something that appears to be undocumented – when setting a PrintJob to printAsBitmap=true OR you are printing from a mac,(using the PrintJobOptions class) it is suddenly important that the object is on the stage, or it won’t print.

so if you didn’t want your object on the stage, the simple solution is to surround your send with an addChild and removeChild like so:

this.addChild(page);
page.visible=false; //for macs only – otherwise they display the page while the print dialogue is open.
var myOption:PrintJobOptions = new PrintJobOptions(true);
my_pj.addPage(page,null,myOption);
my_pj.send();
this.removeChild(page);

iOS development with Swift - book: https://manning.com/books/ios-development-with-swift video course: https://www.manning.com/livevideo/ios-development-with-swift-lv

Tagged with: ,
Posted in Flash
6 comments on “printAsBitmap – object must be on stage
  1. S says:

    Hi

    Is there an AS2 workaround that you can think of? We seem to have come across the same problem although, it's happening in Windows too.

    Only thing is, we're using AS2 for this particular project.

    Thanks

    Shaun

  2. Sorry I don't have a printer handy to test code out for you. Does seem strange that you've come across the same problem – what do you mean by that? that the object needs to be on stage? doesn't the clip have to be on stage to be able to reference it in the PrintObject in AS2?

  3. kaplan says:

    Many thanks Craig!!! You stopped my head from pounding just now with this little posting. That fixed my problem right up!!

    Cheers!

  4. indela sreenivasulu says:

    hi this is indela i am new to flex. i am trying to print 10 images in a folder
    how to print all images in each image is in each page

    thanks in advance.

    • Hi indela, i’m not sure i understand what you’re trying to do. And i’m not sure it’s relevant to this post… perhaps the flex forums might be a better place to look for help?

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: