Skip navigation
Currently Being Moderated

Slow multi-page printing

May 18, 2012 8:38 AM

I'm using the PrintJob class in AS3 to print a multipage list. There is a little graphic header, my company logo in the footer and then just a long text list. It varies from 2 to 6 or so pages.

 

Everything seems to be working, but it seems to take an awful long time to get all the pages out. I'm wondering if anybody has any ideas of where to look? Or is it just always slow?

 

Here is the code I'm using:

 

private function doPrint(a:Array) {

     var pj:PrintJob=new PrintJob();

 

     if (pj.start()) {

          var orgScale:Number=a[0].scaleX;

          var count:Number=0;

 

          for (var i=0; i<a.length; i++) {

 

               a[i].width=pj.pageWidth;

               a[i].scaleY=a[i].scaleX;

               pj.addPage(a[i]);

               count++;

          }

 

          if (count>0) {

               pj.send();

          }

     }

     pj=null;

     a[0].scaleX=a[0].scaleY=orgScale;

}

 

The array is an array of the various movieclips that make up the pages.

 
Replies
  • Currently Being Moderated
    May 18, 2012 9:35 AM   in reply to Rothrock

    The code looks sound. How complex are the pages? You might get a speed bump yet sacrifice text crispness a pinch if you convert your clips to bitmaps and print those instead of the vectors. It's more data to send to the printer but easier to process inside Flash which would likely be the cause of slow printing. Of course your machines speed makes a big difference too..

     
    |
    Mark as:
  • Currently Being Moderated
    May 20, 2012 9:54 AM   in reply to Rothrock

    Check your processes and watch the CPU usage during spooling. See if Flash is continuously using CPU as it does it. If Flash is utilizing <5% processor it sounds like it's just a lot of transfer. If it's uing more than 5% CPU it's probably flash itself translating the pages to a suitable print job.

     
    |
    Mark as:
  • Currently Being Moderated
    May 21, 2012 1:02 PM   in reply to Rothrock

    But the pages are printed successfully, albeit slowly? Do you have any other office printers you can try? That could be anything from Flash to the printers driver. Just trying to eliminate possibilities.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points