• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing documents in a webapp without opening them

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic