You can easily create a filter using cups. Create a new backend in /usr/lib/cups/backend. This can be any executable, including scripts. What cups will do is pass to this executable everything you need to know about how to get the printed file to parse it. Your new backend will then show up in your cups configuration as a new printer type. The following is a little perl script we use to implement a printing dropfolder.
<br><br>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 2.0 (Linux)"><meta name="CREATED" content="20060718;7484100"><meta name="CHANGED" content="16010101;0">
<style type="text/css">
<!--
@page { size: 8.5in 11in; margin: 0.79in }
P { margin-bottom: 0.08in }
-->
</style>
<p style="margin-bottom: 0in;">#!/usr/bin/perl<br>$argument_count = @ARGV;<br>if ($argument_count == 0){<br>open OUTFILE,(">/tmp/cups.error");<br>print "direct drop \"Unknown\"
\"Drop Folder\"\n"<br>exit(0);<br>}</p>
<p style="margin-bottom: 0in;">if (($argument_count < 5) ||
($argument_count > 6)){<br>open OUTFILE,(">/tmp/cups.error");<br>print OUTFILE "Usage: drop
job-id user title copies options [file]";<br>print "Usage: drop job-id user
title copies options [file]";<br>exit(1);<br>}</p>
<p style="margin-bottom: 0in;">$dropdir=$ENV{'DEVICE_URI'};<br>$dropdir =~ s/drop://;<br>unless (-w $dropdir){<br>open OUTFILE,(">/tmp/cups.error");<br>print "ERROR: directory
$dropdir not writable\n";<br>print OUTFILE "ERROR:
directory $dropdir not writable\n";<br>exit(1);<br>}</p>
<p style="margin-bottom: 0in;">$cupsfile = $ARGV[5];<br>`cp \"$cupsfile\"
\"$dropdir\"`;</p>
<br><br><div><span class="gmail_quote">On 7/18/06, <b class="gmail_sendername"><a href="mailto:d.qureshi@mdx.ac.uk">d.qureshi@mdx.ac.uk</a></b> <<a href="mailto:d.qureshi@mdx.ac.uk">d.qureshi@mdx.ac.uk</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Does anyone know how to use a filter to format print files to a printer?<br>I used printtool on RedHat AS 4 to create a print queue. I am aware the printcap file
<br>cannot be editted to put a input filter.<br>Any help would be appreciated.<br>Thankyou.<br><br>_______________________________________________<br>rhn-users mailing list<br><a href="mailto:rhn-users@redhat.com">rhn-users@redhat.com
</a><br><a href="https://www.redhat.com/mailman/listinfo/rhn-users">https://www.redhat.com/mailman/listinfo/rhn-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Stephen Gilbert<br>RHCE - 804006953620491