List Info

Thread: Using filters to format print files




Using filters to format print files
user name
2006-07-18 12:18:28
So can I create shell script which will be my filter to fix
the step affect problem of my output.
But wish to point the filter to a particular print queue I
have created.
Hope this makes sense.



>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.
>
> #!/usr/bin/perl
>$argument_count = ARGV;
>if ($argument_count == 0){
>open OUTFILE,(">/tmp/cups.error");
>print "direct drop \"Unknown\"
\"Drop Folder\"\n"
>exit(0);
>}
>
>if (($argument_count < 5) || ($argument_count >
6)){
>open OUTFILE,(">/tmp/cups.error");
>print OUTFILE "Usage: drop job-id user title
copies options [file]";
>print "Usage: drop job-id user title copies
options [file]";
>exit(1);
>}
>
>$dropdir=$ENV{'DEVICE_URI'};
>$dropdir =~ s/drop://;
>unless (-w $dropdir){
>open OUTFILE,(">/tmp/cups.error");
>print "ERROR: directory $dropdir not
writable\n";
>print OUTFILE "ERROR: directory $dropdir not
writable\n";
>exit(1);
>}
>
>$cupsfile = $ARGV[5];
>`cp \"$cupsfile\"
\"$dropdir\"`;
>
>
>On 7/18/06, d.qureshimdx.ac.uk <d.qureshimdx.ac.uk> wrote:
>>
>> Does anyone know how to use a filter to format
print files to a printer?
>> I used printtool on RedHat AS 4 to create a print
queue.  I am aware the
> printcap file
> cannot be editted to put a input filter.
> Any help would be appreciated.
> Thankyou.
>
> _______________________________________________
> rhn-users mailing list
> rhn-usersredhat.com
> htt
ps://www.redhat.com/mailman/listinfo/rhn-users
>



-- 
Stephen Gilbert
RHCE - 804006953620491

--Boundary_(ID_HPOyFXvBamQs8i6gviL89A)
Content-type: text/html; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
Content-disposition: inline

You can easily create a filter using cups.&nbsp; Create
a new backend in /usr/lib/cups/backend.&nbsp; This can
be any executable, including scripts.&nbsp; What cups
will do is pass to this executable everything you need to
know about how to get the printed file to parse
it.&nbsp; Your new backend will then show up in your
cups configuration as a new printer type.&nbsp; 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">
	&lt;!--
		page { size: 8.5in 11in; margin: 0.79in }
		P { margin-bottom: 0.08in }
	--&gt;
	</style>







<p style="margin-bottom:
0in;">#!/usr/bin/perl<br>$argument_count =
ARGV;<br>if ($argument_count ==
0){<br>open
OUTFILE,(&quot;&gt;/tmp/cups.error&quot;);<br
>print &quot;direct drop
\&quot;Unknown\&quot;
\&quot;Drop
Folder\&quot;\n&quot;<br>exit(0);<br>}
</p>






<p style="margin-bottom: 0in;">if
(($argument_count &lt; 5) ||
($argument_count &gt; 6)){<br>open
OUTFILE,(&quot;&gt;/tmp/cups.error&quot;);<br
>print OUTFILE  &quot;Usage: drop
job-id user title copies options
[file]&quot;;<br>print &quot;Usage: drop
job-id user
title copies options
[file]&quot;;<br>exit(1);<br>}</p>







<p style="margin-bottom:
0in;">$dropdir=$ENV{'DEVICE_URI'};<br>$drop
dir =~ s/drop://;<br>unless (-w
$dropdir){<br>open
OUTFILE,(&quot;&gt;/tmp/cups.error&quot;);<br
>print &quot;ERROR: directory
$dropdir not writable\n&quot;;<br>print OUTFILE 
&quot;ERROR:
directory $dropdir not
writable\n&quot;;<br>exit(1);<br>}</p>
;

<p style="margin-bottom: 0in;">$cupsfile =
$ARGV[5];<br>`cp \&quot;$cupsfile\&quot;
\&quot;$dropdir\&quot;`;</p>
<br><br><div><span
class="gmail_quote">On 7/18/06, <b
class="gmail_sendername"><a
href="mailto:d.qureshimdx.ac.uk">d.qureshimdx.ac.uk</a></b> &lt;<a
href="mailto:d.qureshimdx.ac.uk">d.qureshimdx.ac.uk</a>&gt;
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.&nbsp;&nbsp;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-usersredhat.com">rhn-usersredhat.com
</a><br><a href="htt
ps://www.redhat.com/mailman/listinfo/rhn-users">
;https://www.redhat.com/mailman/listinfo/rhn-users</a&
gt;<br></blockquote></div><br><br
 clear="all"><br>--
<br>Stephen Gilbert<br>RHCE - 804006953620491

--Boundary_(ID_HPOyFXvBamQs8i6gviL89A)--

--Boundary_(ID_BVrZ+kRCU1Ytv4vUwQhzpA)
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline

_______________________________________________
rhn-users mailing list
rhn-usersredhat.com
htt
ps://www.redhat.com/mailman/listinfo/rhn-users

--Boundary_(ID_BVrZ+kRCU1Ytv4vUwQhzpA)--

_______________________________________________
rhn-users mailing list
rhn-usersredhat.com
htt
ps://www.redhat.com/mailman/listinfo/rhn-users
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )