• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to print a file using java codings?  RSS feed

 
kalpana balasubramanian
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all!
i want to print a file thru printer using JAVA. Is there any method or special class so that a file can be printed.
if so,kindly help me.
thankx in advance.
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kalpana,
You can't exactly "print a file" in Java, but depending upon what type of data is in the file, you may be able to read its contents and print them using Java's printing capabilities. You might take a look at the java.awt.print package, and in particular, the PrinterJob class in that package. If you have trouble figuring out how to do the printing, I'd encourage you to consider picking up a copy of my book, as it contains a chapter that describes in detail how to use Java's printing capabilities.
------------------
Brett Spell
Author, Professional Java Programming
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!