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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to networked printer

Status
Not open for further replies.

ludgot

Programmer
Aug 7, 2008
2
SE
Printer was connected to the parallel port of my PC
and was opened by 'open (P,">>","/dev/lp0") or die... and
then printed to with 'printf (P... The printer is now
hooked up to a printer server that has been defined in
CUPS as 'lpd://192.168.123.4/lpt1' i.e. under control of
a Line Printer Daemon and TCP/IP. How do I access it now?
My pc is running Ubuntu Linux 8.04

 
Maybe you could just write it to a file and then lp the file? You might have more luck with this on the Linux forums, as this isn't a Perl issue per se.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Thank you Steve for your tip! If this is a Perl issue or
a linux one I am not sure. I rather think it belongs to
both worlds. Accessing any network entity in general would
be a perl question. Maybe there is some CPAN package that
could do it. I have the Camel but haven't found anything
that seems to fit. With that problem solved it's all linux.
Judging from the number of answers to my question from
various linux forums there doesn't seem to be many perl
experts around in the linux community so I turned to you
guys.
rgds ludgot
 
You don't access the network entity, the CUPS daemon handles this for you. Otherwise you'd have to write something that handled the whole IPP conversation. I'm sure you could do it by opening a pipe to the lp command, which will take standard input with the correct options. I'm not on a Linux box at the moment, so I can't test just now.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top