Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing in Java using PS file

Tags:

java

printing

awt

I have a generated post script file and want to print using it. How can it be achieved in java either using javax print API or AWT. Is it possible?

like image 849
Rachel Avatar asked Aug 04 '26 22:08

Rachel


1 Answers

Complicated. Does your printer(s) support PostScript? Is it networked? If so, most networked printers can talk LPR and you can shove the file over as-is. On Windows, you could also stream the file as-is to the lpt1: mapped port via something like NET USE LPT1: \\[Computer Name]\Printer /PERSISTENT:YES.

If you're on a server and you do lots of PostScript handling and your printer infrastructure supports it, I would very much look into the LPR protocol. I've written several LPR/LPD management functions in Java to handle printer jobs, so definetely know it can be done with some relative ease.

http://tools.ietf.org/pdf/rfc1179.pdf

like image 183
Jé Queue Avatar answered Aug 07 '26 14:08

Jé Queue



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!