Craig Grummitt – Before I forget

Discoveries in Swift and iOS development.

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);


Comments

  1. S Avatar
    S

    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. Craig Grummitt Avatar

    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 Avatar
    kaplan

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

    Cheers!

    1. craiggrummitt Avatar

      Glad to be of help kaplan!

  4. indela sreenivasulu Avatar
    indela sreenivasulu

    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.

    1. craiggrummitt Avatar

      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

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