filters and perl scripts

Romeo Asuncion romeo.asuncion at
Fri Jan 28 08:38:41 PST 2005

Hi all,

I've some perl scripts that do a bunch of preps for printjobs (mostly 
adding company data). These scripts work under lpd, but not now that the 
linux community is moving towards cups, I'm looking into installing them 
for cups. But I need a simple way to install these filters.

I've looked most of the docs at, but it's very sparse. The few 
that I found pertain to C api. Is perl support available for cups? I'm 
testing it out right now w/printing plain text. If somebody could help...

# id jobs via filename
text/foo     footxt 

# pass the job to the text/plain handler
# I'm hoping text/foo has priority over text/plain. How
# do I ensure this??
text/foo     text/plain   0   fooscript

The fooscript is under /usr/lib64/cups/filter:
my $job = shift @ARGV;
my $user = shift @ARGV;
my $title = shift @ARGV;
my $copy = shift @ARGV;
my $opts = shift @ARGV;
my $file = shift @ARGV;
# The first handler opens a file. The rest receive
# from stdin. I want this script to be first.
open fh, $file or die;
while (<fh>) {print;}
close fh;

Sadly, only a couple of escape sequences are sent to the printer (the 
printer is actually a remote host running LPD). I didn't post any logs, 
because I'm not sure if the script or the mime comform to cups api. Thanks.

Romeo Asuncion
Qual-Pro Corp.
romeo dot asuncion at qual-pro dot com

More information about the cups mailing list