Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Specialized printing from a JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Specialized printing from a JSP page" Watch "Specialized printing from a JSP page" New topic
Author

Specialized printing from a JSP page

Mora Yung
Greenhorn

Joined: Dec 27, 2000
Posts: 5
Hi everybody.

I have a JSP page with some controls and a Print button. What I want it to do is when I click the Print button, the print dialog box would show. I would choose what printer to to send this job to. But when I press the button to start the printing, I don't want to print the "screenshot" of the page. Instead I want to send the contents of controls in a text format.

For example, the JSP page would have a text box with a value of "Hello World". So what I would like is to send just the text "Hello World" to the print queue.

Is this possible? How would I override the data that gets sent to the printer?

Any help is appreciated.
Thanks.

Dickson
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

You would have your print button submit a new request that returns the data in the format you desire. Javascript on the 'print page' could initiate the print sequence. If you don't want a new page to pop up, you could submit this to a hidden iframe on the original page and no one would be the wiser.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Specialized printing from a JSP page
 
Similar Threads
Using applet to print
Print text of JtextField in java Swing using Printer
Printing
Capturing the current window's cotents??
Capturing the current window's cotents?