• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use java to print out a string through a printer?

 
Samuel Chan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone give me some example or source code?
Thanks.
 
Amit Agarwal
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Samuel,
you need to prepare a buffered image, and write to it using its Graphics Context. This buffered image can be then printed using the PrinterJob class. for better explanation of this, see java documentation.
Amit
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!