posted 22 years ago
2nd way to send a job to the printer:
Following is the discussion between me and William Brogden (Bill)
By Faisal Ahmed Farooqui (Faf) on Wednesday, July 11, 2001 - 02:46 pm: Edit
can any 1 pls tell me.
how can i send output to the printer using java.io classes
===
FAF
By William Brogden (Bill) on Wednesday, July 11, 2001 - 03:33 pm: Edit
If you just want to send a stream of characters to a printer, it would depend on how your operating system addresses the printer. On some systems you can open the printer like opening a file.
If you want to print a graphic page from a AWT or Swing application, look into the PrintJob class in the java.awt package.
By Faisal Ahmed Farooqui (Faf) on Wednesday, July 11, 2001 - 07:54 pm: Edit
thanks Mr. Bill
Im specifying following details of my printer and OS
OS : Windows 2000 server
Installed Printer : HP DeskJet
Specified printer name : HP
Port : LPT 1
can u tell me how can I use it as a file? I mean which location would I have to provide in constructors.
thanks again
===
FAF
By William Brogden (Bill) on Thursday, July 12, 2001 - 12:17 am: Edit
It has been a while since I have done this but I think you can open it as
FileOutputStream( "LPT1:");
By Faisal Ahmed Farooqui (Faf) on Thursday, July 12, 2001 - 08:27 am: Edit
I m very very thankful to u Mr. Bill
It's working perfectly
===
FAF