save my brain fromshut down - PLEASE - print screen to fit A4
Hi there.....
just in the last stages of a major CDRom project and I'm having problems with printing....
any ideas anyone...?!?
All I want to be able to do is for users to click the print button which sends the current screen to print, adjustng size to fit onto a portrait A4 sheet. Tried it but can't get it to work, tried targeting the bframe, nothing...
Any ideas, thoughts, tips or tricks... would be much appreciated ;)
Try this for printing to size
As I understand it, all printers assume the file you send them is 72 dots per inch. I am using Flash MX which has a PrintJob class this is available with Flash 7 and beyond. Look up PrintJob in the Flash built-in help.
In general the steps are
- create a new PrintJob object say myPrintJob
var myprintjob:PrintJob = new PrintJob();
- Call the start method for your print job
var result:Boolean = myprintjob.start();
This call will attempt to bring up the print dialog box. In the meanwhile, the action script waits for a response. Once the user presses print or OK and the printer is ready to print, the start method will return a boolean (result in the code above)
- if (result) // result is true and the printer is ready to accept print
check if the printer is portrait or landscape.
create the picture you want to print. This may involve blanking out some screen elements that are currenly diplayed.
size clip(s) (or page frame(s) to come out the proper size. (must be done first)
rotate the clip you are printing accordingly.
- send the page or pages
myprintjob.addPage("myPrintReady_mc")
- Then if you are displaying what you printed, undo the changes you made to make the job print ready
- Make blanked out elements visible
Here is how I control size.
In general using the
- if I want to print out to the size N x M inches, I size the movie clip to
N (inches)* 72 (dots per inch) by M *72 \
Try this for printing to size
Sorry, on the last post, I hit the enter key to soon. Here is the whole thing.
As I understand it, all printers assume the file you send them is 72 dots per inch. I am using Flash MX which has a PrintJob class this is available with Flash 7 and beyond. Look up PrintJob in the Flash built-in help.
In general the steps are
- create a new PrintJob object say myPrintJob
var myprintjob:PrintJob = new PrintJob();
- Call the start method for your print job
var result:Boolean = myprintjob.start();
This call will attempt to bring up the print dialog box. In the meanwhile, the action script waits for a response. Once the user presses print or OK and the printer is ready to print, the start method will return a boolean (result in the code above)
- if (result) // result is true and the printer is ready to accept print
check if the printer is portrait or landscape.
create the picture you want to print. This may involve blanking out some screen elements that are currenly diplayed.
size clip(s) (or page frame(s) to come out the proper size. (must be done first)
rotate the clip you are printing accordingly.
- send the page or pages
myprintjob.addPage("myPrintReady_mc")
- Then if you are displaying what you printed, undo the changes you made to make the job print ready
- Make blanked out elements visible
- size back to the screen display size
- Rotate back to original rotation
Done!!!
Here is how I control size.
In general printers want to assume 72 dots per inch.
- if I want to print out to the size N x M inches, I size the movie clip to
N (inches)* 72 (dots per inch) by M *72
for 8 1/2 by eleven this becomes 612 * 792
NOTE: This is to big for most printers the pritable area is smaller than the page size. You can find out the printer paper size and maximum printable are by looking at attributes of you print job
eg. myprintjob.paperWidth, myprintjob.pageWidth
Hope this helps.
MikeC