Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to print on a Network Printer??  RSS feed

 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a piece of code which uses LPT1: port to print a certain file. The code is as follows

Now if the printer is on the network then what changes need to be done in the code in order to access the network printer.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your best bet would be to use the Java Print Service. Despite its name, a PrintWriter has nothing to do with printers, it simply provides methods to format text output.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!