Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javax.print package direct to printer 2

Status
Not open for further replies.

sedj

Programmer
Aug 6, 2002
5,610
Hello,

Problem is :

I need to either print direct to a printer - without going through the spooler (ie in Win32 the spoolsv.exe process) and be notified when the job has actually finished printing (not just successully spooled to printer RAM),

OR

Get real "print job" has finished notifications.

I've pretty much tried using all the javax.print API, and they all seem to spool through the native spooler process. Using (in Win32) the spooler's 'print direct to printer' option is not acceptable.

The (HP) printer speaks IPP, and supports JetDirect (HP's own protocol ?) ...

Anyone ever succeed in printing [postscript] to a printer direct ?

Cheers for any help !

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I known I will not be of much help. But our famous Oracle system built with webforms does just that, but I'm sorry to say I don't know how they do it, it doesn't care wish brand it is as long as it talks postscript and they don't use the drivers nor the spooler. Sorry to be of little help. It just know it can be done.

Christiaan Baes
Belgium

"Time for a new sig." - Me
 
Well, don't keep us in suspense.

Christiaan Baes
Belgium

"Time for a new sig." - Me
 
Sorry guys, been flat out the last few days to look at this. Unfortunately the search continues.
I've started to look into C/C++ spoolers to see if there is anything I can use there instead. I think Java has run out of steam on this one ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Hi Stefan,

Yeah I've tried implementing all the available listeners - but the problem is that the javax.print API seems to print to the native spooler, which notifies when it has recieved the job, not when the actual paper has finished coming out of the machine. Setting the spooler to operate in synchronous mode does not work either.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Finally managed to work out how to do this - and ironically its so simple, its almost unbelievable.

Not sure if it works for every printer, but it works for HP 8100 series printers, for postscript files :

Open a java.net.Socket object on the printers IP, on port 9100.
Dump the postscript file down the outputstream.
Close the socket.

If the printer is busy, it holds the read of the stream until it can accept another job.

Cracking !

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
You can't give somebody a star for solving his own question.

Of course that will only work for network attached printer how about localy attached printers?

Have a star anyway.

Christiaan Baes
Belgium

"Time for a new sig." - Me
 
I can give him a star for providing information which I think is helpful, however it comes about, Chrissie.

Anyway, it's good to give[smile].

Tim
 
lol, are you boys fighting over me ? ;)

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top