Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to print without seeing the print dialog box?  RSS feed

 
Anand Kaimal
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'd like to print an html or rtf file to a printer without having the print dialog box poping out. I've been told that you could only bypass the print dialog box by playing in the peer win32. Where can I find it? I've been also told that jdk 1.2 offered the possibility of not having the dialog box pop up; but how do I implement the class Printable print fonction? How do I link the Book to it?
Thanks
Anand.
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anand,
It is possible in Java 2 to use PrinterJob to print without displaying the print dialog. In fact, PrinterJob only ever displays the dialog when you ask it to do so.
While I'd be happy to answer all of the questions you asked about how to use PrinterJob and the related classes, I'm afraid that it would take quite a bit of time and typing for me to do so. Instead, I'd encourage you to pick up a copy of my book, since it includes a chapter on printing that will answer your questions.
------------------
Brett Spell
Author, Professional Java Programming
 
Brian Coates
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about in Java 1?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!