[ic] lpr within a usertag

Grant emailgrant at gmail.com
Sat Feb 2 19:33:21 EST 2008


> >>>> I'm able to print from my remote IC machine to my local printer server
> >>>> with 'lpr file.pdf' but I'm having trouble making it work within an IC
> >>>> usertag.  I'm using the following to test it:
> >>>>
> >>>> Usertag print Order
> >>>> Usertag print Routine <<EOR
> >>>> sub {
> >>>>         'lpr /catalogpath/file.pdf';
> >>>> }
> >>>> EOR
> >>>>
> >>>> I've also tried specifying just file.pdf without the absolute path but
> >>>> neither works.  There is nothing in either error.log.  Does anyone see
> >>>> what's wrong here?
> >>> Not that this is a great way to do this, but try using backticks (`)
> >>> instead of single quotes (').
> >>>
> >>> See Net::Printer
> >>> <http://search.cpan.org/~cfuhrman/Net-Printer-1.04/lib/Net/Printer.pm>
> >>> for a better solution.
> >>
> >> Why do you prefer Net::Printer over 'lpr file.pdf'?
> >
> > Because IC doesn't have to launch an external program that way.  It's
> > nearly always better to use a perl module for any given task than it is
> > to use a system call for various reasons of portability, lower process
> > count, not having to fork, etc.
>
> Mike pointed out to me that I may be incorrect in this case, he said:
>
> > In this case, lpr may be superior, because it will send jobs to
> > Samba and CUPS printers. Net::Printer will not unless you have put
> > the LPD compatibility interface in....
>
> So in this particular case it may be better to use lpr via a system
> call, especially if you plan on sending to a cups or samba printer in
> the future.
>
>
> Peter

Thanks Peter.  I was disappointed when I saw that I'd have to set up
cups-ldp with xinetd to use Net::Printer with my cups server.

- Grant


More information about the interchange-users mailing list