This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes Print Directly from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Print Directly from JSP" Watch "Print Directly from JSP" New topic
Author

Print Directly from JSP

Monica Salvador
Greenhorn

Joined: Feb 24, 2011
Posts: 23
Hi. I'm trying to have a report printed out from a PDF attatchment that I have made with iText in a Struts2 action. But apparently, that won't work because the printing control must come from the website itself or else, I wouldn't be able to keep track of what document numbers have been printed or how many of the reports have been printed. Is it possible that I could print the PDF file I made from iText and instead of having it attached or opened in Adobe Acrobat Reader to be printed directly? Or could I control the printer to have it printed at once instead?

Thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60074
    
  65

Are you taking about automatically controlling a printer at the client location? Of course not. Think about the security implications. Would you want any web site you visit to be able to start printing out ads on your printer?

All you can do is to let the user download the file and decide what to do with it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Monica Salvador
Greenhorn

Joined: Feb 24, 2011
Posts: 23
It's not like that.. I just want to keep track of the transactions, besides, the website is not a real website anyway. It's some company's website and it would run on a VPN. The thing is, if I don't keep track of the printing, money would be lost and lots of it. Seriously.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60074
    
  65

You'll need to seek some technology other than pure HTTP. I'm not sure, but perhaps a privileged applet might be able to exert the control you seek. At least it's a direction to investigate.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Print Directly from JSP
 
Similar Threads
Printing the resultset properly
immediate help - java print a pdf
Printing textual data from browser
Printing a PDF without opening it
what is itext?