f



Sending a file file to printer using command line

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.
0
rudranee (142)
4/20/2009 11:11:45 AM
comp.lang.java.programmer 52714 articles. 1 followers. Post Follow

7 Replies
584 Views

Similar Articles

[PageSpeed] 8

On Apr 20, 12:11 pm, ruds <rudra...@gmail.com> wrote:
....
> 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)

:)



0
cbossens73 (77)
4/20/2009 1:36:53 PM
ruds wrote:
>> Also I want to give the i/p file name and o/p file name as arguments

cbossens73@yahoo.fr wrote:
> Where do the "i/p" and "o/p" notation for "input" and "output"
> come from?

No, no, no - "i/p" means "Internet protocol"!

-- 
Lew
:-)
0
noone7 (4050)
4/20/2009 2:06:48 PM
Lew wrote:
> ruds wrote:
>>> Also I want to give the i/p file name and o/p file name as arguments
> 
> cbossens73@yahoo.fr wrote:
>> Where do the "i/p" and "o/p" notation for "input" and "output"
>> come from?
> 
> No, no, no - "i/p" means "Internet protocol"!

I tend to use "IP" for that ...

:-)

Arne
0
arne6 (9808)
4/20/2009 11:22:29 PM
In article <49ed03af$0$90275$14726298@news.sunsite.dk>,
 Arne Vajhøj <arne@vajhoej.dk> wrote:

> Lew wrote:
> > ruds wrote:
> >>> Also I want to give the i/p file name and o/p file name as arguments
> > 
> > cbossens73@yahoo.fr wrote:
> >> Where do the "i/p" and "o/p" notation for "input" and "output"
> >> come from?
> > 
> > No, no, no - "i/p" means "Internet protocol"!
> 
> 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>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
nospam59 (11088)
4/21/2009 2:50:07 AM
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.



0
rudranee (142)
4/21/2009 5:11:02 AM
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.
0
rudranee (142)
4/22/2009 10:41:19 AM
In article 
<31ed830a-0687-45c3-beda-81e78512b80f@u39g2000pru.googlegroups.com>,
 ruds <rudranee@gmail.com> wrote:

> 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.

You might try implementing SingleThreadModel in a servlet:

<http://java.sun.com/products/servlet/2.1/api/javax.servlet.SingleThreadModel.html>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
nospam59 (11088)
4/22/2009 3:11:04 PM
Reply: