This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Batch Printing using Java APIs.

Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing critical issue in one of my application.
I am having a Java �Web Application� with a link/button called �Batch Print�. On click of the button, I want to export some documents to a temporary location on client machine and then I want to �Print� all these documents using �Java APIs�.
We are having reusable component for exporting files, but the problem lies when it comes to printing.

For e.g. I am having the files to be printed at �C:\Temp� folder on my local machine. These files can be any file in �.doc�, �.xls�, �.ppt�, �.pdf�, �.spdf�, �.txt�, �.tif�.
Now I want to develop a code which will run at client side (either JavaScript or standalone Java code) which will take all these file names as a input, and print them using default printer.

I have also tried to evaluate the �Print� functionality which appears in the context menu. i.e. When we right click the file in �Windows Explorer� and click �Print�. But didn�t find any useful information.

Any idea how this can be achieved?

Thanks and Regards,
Dhiraj Raut
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far a JavaScript is concerned, I think the only thing you can do is print the current page via the browser's printing capability (window.print() does it I think). You might want to double check this in the JavaScript/HTML forum.

You could write an Applet that does this. It would need to be a signed Applet since it would need access to folders outside the normal sandbox. If a signed Applet is an acceptable solution, you can just use the Java Print Service API to batch print.
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Java Code Review and Psychology
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!