/ Published in: ActionScript
Random notes on how to execute a Print function
Expand |
Embed | Plain Text
var myPrintJob:PrintJob = new PrintJob(); var result:Boolean = myPrintJob.start(); if (result) { myPrintJob.addPage("invitation_mc", {xMin:30, xMax:250, yMin:27, yMax:300}, {printAsBitmap:true}, 2); myPrintJob.addPage("map_mc", null, {printAsBitmap:false}, 1); myPrintJob.addPage(1, null, {printAsBitmap:true}, null); myPrintJob.addPage("guestList_mc", null, {printAsBitmap:true}, 4); for(i = 1; i <= myMovieClip_mc._totalframes; ++1){ myPrintJob.addPage("myMovieClip_mc", null, null, i); } myPrintJob.send(); delete myPrintJob; } else { //User does not have printer or user canceled print action }
Comments
Subscribe to comments
You need to login to post a comment.

if(pj.start()) will not only invoke the start method but also produce a boolean in one line which reduces the total amount of code
if(myPrintJob.start()){
etc...
}
Not good enough to understand all that.. but would creating a button called PrintJob execute the code?
-Eric
I highly suggest you give this a look. http://alivepdf.bytearray.org/
This isn't AS3 at all?!
kmoth, good point. Thanks for the catch.