File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing from JSP

 
Gobind Singh
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web page with a hyper link on it labeled 'PRINT'

The requirment is that the print link needs to send a document to a printer via CUPS on linux.
The document is stored on disk (within the directory structure of the web server).

I am using Jonas web server (which uses Tomcat for its servlet container) installed on Linux.


Any ideas on how I can do this? Is there a printing API for web applications that I need to use?

The steps that i need to take are:

1.user clicks on the PRINT link
2.Servlet determines the session id of the user
3.Servlet grabs the document associated with the session Id from disk
4.Servlet sends the document to a printer via CUPS
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is this printer connected?
 
Gobind Singh
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The printer is on another server.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is prinintg server-to-server a feature of CUPS (with which I am unfamiliar)? It's not a feature of any servlet container.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Containers don't provide any printing functionality but a Google search for "java.awt.print.PrinterJob" and "lookupPrintServices" will bring up plenty of information for finding and using printers in a Java App.
 
Gobind Singh
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I followed your suggestion and found some good examples.
Hopefully I will be able to incorporate them into my webapp.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic