Sending a file file to printer using command line

R

ruds

Hi,
I want to print a file using servlet/JSP through command line.
For this should I call the *.dll file of the printer driver?
Also I want to give the i/p file name and o/p file name as arguments
to the printer.
Is it possible? How to go about it?
Thanks in advance.
 
C

cbossens73

I want to print a file using servlet/JSP through command line.

You want to print a file from the server running your Web app?

For this should I call the *.dll file of the printer driver?

You want to print a file from the *Windows* server running your
Web app?

Where's the printer?

Also I want to give the i/p file name and o/p file name as arguments

Where do the "i/p" and "o/p" notation for "input" and "output"
come from?

Apparently you're not the only using these even tough it doesn't
look very common.

You're saving two characters at the expense of readability IMHO.

Anyway, I tought the "o/p" [sic] was the printer?

I've got an internal Webapp here running on a Un*x server.
There's a good professionnal network printer speaking native
PostScript running on the network.

If that helps, calling, say:

cat ruds.ps | netcat 192.168.0.44 9100


from Java will print the file ruds.ps just fine.

So if you really want to print something "from
the command line", yes, it's possible.


Maybe you should try some lolcode:

HAI
CAN HAS o/p PR1NT3R?
YARLY
IM IN YR LOOP
VISIBLE i/p
IM OUTTA YR LOOP
NOWAY
KTHX
KTHXBYE

(from lolcode.com)

:)
 
J

John B. Matthews

Arne Vajhøj said:
I tend to use "IP" for that ... :)

Ah, Intellectual Property, of course! :)

BTW, their Royal Highnesses Crown Prince Frederik and Crown Princess
Mary of Denmark were recently featured on the cover of a popular US
Sunday newspaper supplement:

<http://www.parade.com/news/2009/04/what-is-royalty-in-the-21st-century.html>

Ob Java: I think the OP's trying to use this, but my Windows-fu is too
weak to help:

<http://pdfcreator.svn.sourceforge.net/svnroot/pdfcreator/trunk/Help/english/html/commandline.htm>
 
R

ruds

Yes, I'm running my web app on windows server. The *.dll file is
present C:\WINDOWS\system32 folder.
i/p means input and o/p means output.
And PDFCreator IF and OF commands can be used only for postscript and
bitmap files not foe MS office files.
Can someone help me with a sample code to be used in servlet as I'm
not getting the required thing correct.
 
R

ruds

I have tried using the Desktop.print() command also.
When I call the java file containing the above command, my JSP does
not produce any o/p nor stops.
It just runs for a long time even if the session it timed out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top