[jcifs] Printing

Michael B. Allen miallen at eskimo.com
Thu Mar 6 07:11:00 EST 2003


On Wed, 5 Mar 2003 17:16:52 -0000
"Steve Blasdale" <steve.blasdale at elevon.cc> wrote:

> Back in the middle of 2002 someone asked if printing was available.  I have
> tried and also followed the example posted and get the same results showing
> that printing is not supported.
> 
> 
> jcifs.smb.SmbException: Invalid parameter
> 	at jcifs.smb.SmbTransport.send(SmbTransport.java:496)
> 	at jcifs.smb.SmbSession.send(SmbSession.java:107)
> 	at jcifs.smb.SmbTree.send(SmbTree.java:92)
> 	at jcifs.smb.SmbFile.send(SmbFile.java:466)
> 	at jcifs.smb.SmbFile.open(SmbFile.java:551)
> 	at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:131)
> 	at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:94)
> 	at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:64)
> 	at Put.main(Put.java:11)
> Exception in thread "main
> 
> I would like to print to an NT printer from a Java Webserver running on UNIX
> in plain ASCII text.  Is there a way to do this?

It's close but as you can see no cigar. We looked into this early on
and (I) decided it wasn't very attractive because there was no way to
extract anything printable from the Graphics implementation to send
to the printer. But if you just want to print plain text (or trival
PostScript) this is doable and would probably not even be that much
code. Unfortunately it undoubtedly means breaking out Ethereal and
capturing a few print jobs to see what needs to be done. I'm very busy
at the moment with other things and jCIFS is stable right now so I
don't think I'll get around to this soon but I'll put it in docs/todo
(if it isn't already). If you are savvy enought to get a capture I'll
look at. Maybe it's trivial. Donno.

Mike

-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and, more important, to tasks that have not
yet been conceived. 


More information about the jcifs mailing list