Java Print Service Problem
Since I didn't find a separate Java Print Service forum, I'm posting my question on this forum as my question is related to a servlet.
Is there anyway I can print to a network printer from my servlet hosted on a solaris server? The particular network printer in question is not configured but accessible from the server. If there is no way, I read in some forums that we can implement the PrintService interface to accomplish that. Anyone has any idea about creating a custom PrintService class for that pupose?
Any help is appreciated.
Regards
Bala
I've used the javax.print long time ago just for fun, but I can't give you a guaranteed solution for your problem. I can give you a hint and then you go on with your own, anyways, I think you should use the javax.print.attribute.standard.PrinterURI
class,since this class is about location the printer you wish to print by it...
first you should try to find the URI of the printer, and create an instance of PrinterURI
using the URI, then you should get an instance of the javax.print.attribute.AttributeSet
, append the PrinterURI
, since it's an Attribute
, to the set, Finally use the javax.print.PrintServiceLookup
Class to get youer lovely PrintService[]
...
next time, find a propper place for this topic, there is a topic for suggesting new topics in the forum,
Good luck,
Regards,
Mohammed Saleem