views:

34

answers:

0

I am trying to print from an Adobe Air App that embeds an AJAX app.

The print function looks like this:

function printPage() {
  asyncSetupForPrint(printCallback);
}

function asyncSetupForPrint(printCallback) {
  synchronousMethods();
  if (printCallback) printCallback();
}

function printCallback() {
  var pjob = new window.runtime.flash.printing.PrintJob;
  var psprite = window.htmlLoader;
  pjob.start();
  // etc...
}

However the print dialog is coming up before the synchronous methods have been executed. Is the AIR JS runtime optimizing something? And if so, is there any way to stop it doing that?

(The setup function is doing things like changing the resolution to huge*huge so that the print out looks ok.)

related questions