I have to do some printing in as3, obviously with flash.printing.PrintJob but I have a problem with it.
I have to validate that the settings set by the user in the printing dialog showed by PrintJob.start() match some stored in the database, and there is no way to get that info other than calling PrintJob.start().
If the page settings are invalid, I never call neither addPage() nor send(), but after some seconds (15 aprox) a blank document is printed.
Any idea? How can I cancel a PrintJob? In AIR there is a PrintJob.terminate() but I'm targeting flash.
Thank you!
Im a little puzzled what your actually trying to do, but cant you do it like this? (from printjob docs, the start function example)
var myPrintJob:PrintJob = new PrintJob();
if(myPrintJob.start()) {
// addPage() and send() statements here
}
This way you can check the settings, if you dont send() it really shouldnt print. (are you sure you dont have send somewhere in a old spot in your code??) A possible fix (though not the best, it should work) is to force your printjob to reset if its settings dont match your preferences, like so;
myPrintJob = new PrintJob();
If the above doesnt help, please supply snippets and more details. Good luck!