• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing documents in a webapp without opening them  RSS feed

 
ravi D shankar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I have a requirement in a web-app page where lots of filenames will be displayed and when some of them are selected and submitted those documents should automatically sent to a default printer for printing.These files should not be opened.All the files are of different formats. Is there a way to accomplish this type of functionality in Java?

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can match the document type to the application that can print it, AND the application has a command line print instruction, you can use one of the java.lang.Runtime exec() methods to start the printing process. The various requirements and pitfalls for this sort of thing have been discussed in this forum frequently.
Bill
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime.exec could only work on the client side if run some kind of applet *and* you know what programs are installed on the client.

Otherwise you will probably have to look into JavaScript, if it is possible at all.

Where exactly is the requirement coming from?
 
ravi D shankar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

My requirement is that I get files from a database or a filesystem and display the filenames to the user.The user selects the files he needs to print and says done.The files have to be pulled out and sent to the default printer automatically.The formats can be different for each file.

I was actually going through an Apache XSL-FO example where the rendered "fo" is being directly sent to the printer successfully but it is for templates and I have already existing full documents in my database.So thought of asking you guys for help

Thanks
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ravi D shankar:
My requirement is that I get files from a database or a filesystem and display the filenames to the user.The user selects the files he needs to print and says done.The files have to be pulled out and sent to the default printer automatically.The formats can be different for each file.


Who are the users? How much control do you have over the configuration of the clients?

I was actually going through an Apache XSL-FO example where the rendered "fo" is being directly sent to the printer successfully


How does *that* work? Do you have a link to the example?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!