简体   繁体   中英

Printing in Java Web Applications

I developed a stand alone application for a medical channelling centre with VB6 seven years ago. There is a mandatory requirement of printing of a chit with a small size(219mm to 140mm) with a single click without the print dialog. Intermittently they need to take reports to full A4 pages from a different printer.

This could be easily achieved in VB6 with setting the printed and paper properties in variables. Now the center want to convert it into a web application, but beforehand they want to make sure that the printing capabilities can be achieved in such web application. They want specifically not to bring the printer dialog box every time.

Is it possible to change printer and paper properties in a web application with Java EE without bringing the printer dialog?. (at least with the support of Jasper reports, etc)

It is possible; however, you need to keep in mind which application would be printing.

If it is the web browser that is printing the web page, you are out-of-luck, as the web browser is already coded and will do exactly what it will always do.

If it is an application embedded within the web page, provided the application can connect to the client machine's printing resources, it is possible; however, often such a task implies that the application is trusted as a remote machine (the web server) is now using local resources (client disk and printing configurations). You may need to pre-configure the machine to elevate that application's level of trust, or you might get a popup declaring that a remote machine (the web server) is trying to use local resources.

If it is a multi-tiered application, and the web server receives the request to print from the web application, then the web server will be doing the printing. The web server trusts itself; however, its environment might be quite different. It may or may not have access to connect to nearby printers, depending on the rest of the network architecture and security policies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM