tags:

views:

234

answers:

1

I'm trying to print from a html/javascript AIR app. The code I'm using is:

var pjob = new window.runtime.flash.printing.PrintJob;
if (pjob.start()) {
    var poptions = new window.runtime.flash.printing.PrintJobOptions;        
    poptions.printAsBitmap = true;
    pjob.addPage(window.htmlLoader, null, poptions);
    pjob.send();
}

I copied it from this blog here which claims to have a working app: http://anirudhs.chaosnet.org/blog/2008.02.15.html

In both my own code and the example code on the blog, when I run the functions to print it pops up the Page Setup box and when I click OK in this, adl outputs the following error to the console:

2009-04-28 22:00:33.950 adl[19891:10b]  ERROR

It still goes on to launch the final print dialog though, but when I click Print it only prints out the top left quarter of the application's window. Both apps I've tried do the same thing, produce the error and then crop the output.

I'm using the CLI development tools on a mac. I know the mac doesn't support vector printing but I'm choosing the Bitmap option. What does this error mean and why is it cropping the print job to the first few hundred pixels x and y ?

A: 

I'm not an expert, and am struggling with the print job for some other reason, but try giving the print rectangle (the second parameter to addPage)

Tanmay

related questions