PDA

View Full Version : Setting up for printing.


Bwe
02-09-2009, 02:36 AM
Hey everyone,

Im working on a fairly simple quiz app, but setting it up for printing is giving me a little bit of a headache.

I would like to make printing easy and as non-tedious as possible. So I was hoping for a user to be able (if possible) to go through the entire quiz then print each page at the end, rather than having to print each screen as they go.

Im wondering if im using dynamic data etc, what are some tips to how I would best set this up?

It will have to be across multiple frames inside a movieclip, so will data be preserved to print if a user goes from frame to frame? Or can I add the pages to a new printJob as the user clicks next, next etc. preserving the data?

Im hoping to have it as a little AIR app by the end. I have been reading up on the printJob class and im sure that can do what I need, but i havent worked with dynamic data & printing before, hence the question.

Thanks!

rawmantick
02-10-2009, 01:04 PM
There is a PrintJob (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/printing/PrintJob.html) class. It has addPage() (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/printing/PrintJob.html#addPage()) method. And thanks god the method does not require the source sprite to be in active display list. The method is like for printing one real physical paper page.

So:

Along with moving the user through the quiz you create (or use existing) sprites (pages of your quiz) that are results. You simple create a print job before the quiz and add every page to the job. After all user is offered to click a "print" button. All the required information is already ready!

Hope it helps...

Bwe
02-10-2009, 11:02 PM
Ah thats great, thank you!

So i can create a sprite of the active frame, resize it offstage to fit A4, add it to the job, then print once the user finishes the quiz.

Im guessing the sprites will have to remain off stage until the print job is completed, then I can remove them.

The reason is the quiz is also presented in print, so I would like the screen version to be as close to the print version as possible, without any navigation elements etc.

Perfect. Now just to figure it out!