Forum OpenACS Q&A: batch printing from the browser

Collapse
Posted by Hamilton Chua on
Hello,

I am considering the use of openacs4.2 for a particularly unique
requirement. The system that is to be developed needs to gather data
from a database (easy enough so far), put it into a text file with
page breaks ( manageable ) and automatically print it's contents
from the browser with the click of a button (now I stomped).

My question is whether it is possible to do this - print a text file
from a browser.

Thanks

Collapse
Posted by James Harris on
As far as I'm aware, the only way to do it is using JavaScript as suggested above.  That would make sense, given that it is a client action.

Of course the other option is "File -> Print" which is much more reliable than client-side JavaScript.

You could probably do something with Active X but that would obviously limit your audience.

The choice of whether to use OpenACS on the server side is completely different from how you print the pages on the client side.

Collapse
Posted by Michael A. Cleverly on
Is this for some sort of internal batch processing? If so, can you dictate the client software used for this task? Or will Random Joe Public web surfer need to be able to print in one click?
Collapse
Posted by Hamilton Chua on
Yes, we can dictate the software. This printing will be done on
remote sites and will not be accessible to the public - only to
internal personnel.

I have already developed a solution based on
http://www.meadroid.com/scriptx/

It's an active x control that runs on the client side and allows me
to control the paper width, footer headers and page setup of the
document to be printed.

Since it's activex a requirement is using IE4 or higher.

What I do is display the text file in a browser window with the
appropriate page breaks (using CSS) and make a call to the print
funciton on the onload event.

However, I am very welcome to other ideas.

Many Thanks for responding.