Jump to content

Mass printing - is it even possible?


PaperTiger

Recommended Posts

Hi,

 

We have various reports which can be printed off by our staff, for each individual student, which work by generating a simple HTML page and then using the javascript print method on the document load to print it off (or Ctrl+P, whatever it's just a normal HTML page). Pretty standard and simple.

 

However, one of the managers has decided in his infinite wisdom and obsession with printing everything that he can, that he wants to have one button which he can click to print off all reports for every student in the system. Now since these reports are generated at run time, building up the HTML page, I can't see any way to do this other than literally have it create one massively long HTML page with all the reports, which will no doubt take hours and hours to load, and then just print in the normal way.

 

Is there any other way this could be achieved?

 

The only other thing I can think of at the moment is change it so that when a report is generated it saves a copy to a file somewhere, but even then it would still have to load it up in order to use the javascript print method, and there would be plenty of reports that won't have been run yet, so they would still need to be generated, and as php is server side I am 99% sure there's no way for it to communicate with the client's printer to just say "print all these things".

 

Any ideas at all?

 

Cheers.

Link to comment
Share on other sites

I originally had them generated as PDF documents, but found it to be very unreliable no matter what library I used, and it didn't work cross browser either, so I went back to HTML.

 

If they were generated as PDFs though, surely it would run into the same issue of having to sit there loading up an enormous file for hours on end before it would actually print off?

Link to comment
Share on other sites

It would still take time to generate the file. Depending on what kind of setup you have, you may be able to send the file to the printer after generation rather than download it and print it locally.

 

For one of our mass-print setups we do as mentioned by trq. Each report is generated as a PDF and the user can choose to either download/print the reports individually or select a bunch of them and download/print all. The download/print all simply merges the individual PDF's into a single large PDF and then sends it to the browser.

Link to comment
Share on other sites

I should also have mentioned that we had a custom applet written in Java that enabled us to stream these pdfs to a printer without ever loading into the browser.

 

I don't work at that place any more and the framework I wrote (php api) to do this isn't open source, but it was all built on top of Jasper Reports.

 

You mention "students" which is funny because the company I built this for build administration applications for schools. Our system was capable of producing (and printing) school reports for every student within a year at a time.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.