[cups.general] (long) Filter script on raw printer?
Tim Pushor
timp at crossthread.com
Mon Nov 22 15:44:11 PST 2004
Hi all,
First of all , I am very new to cups and Linux. Also I hope that this
isn't too common a question - I've searched the web but havn't found
anything conclusive.
I am using Suse Linux 9.0 with the version of cups that comes with that
release (1.1.19-75). I have created my printers with the included gui
tools. I needed to create the printers driverless (raw) to get our
application to print properly.
This application is a SCO application that we are porting to Linux. It
is a BASIC interpreter.
The problem that we are having is it seems that using the HP/Jetdirect
printer driver stuff for SCO handled ensuring that the output lines were
terminated with cr/lf properly. Printing through this new raw printer
doesn't work properly.
I took a print job from our application and sent it through a perl
script I wrote to ensure proper EOL termination, and then printed that
job via cups via lpr and it printed properly.
So now I would like a way to get this script working as a filter on this
raw printer. I have tried a few things trying to get this script to
fire, with no luck. At this point I really just want to prove that *a*
script is firing with every print job, but can't seem to even get that far.
This is what I did:
Use the printing manager built in to Suse 9.0 (Utilities -> Printing ->
Printing manager)
- Add Printer/Class
- Backend Selection: Network Printer (TCP)
- Set printer address properly
- Printer Model Selection: Raw Printer (No driver needed)
- Set printer name to something
- everything else default
Now the printer prints, with the linefeed problem.
So I click on the printer in the printer manager, click the instances
tab, click the settings button, and click the 'filters' tab
I click the funnel icon, and make a new filter and call it AutoLinefeed.
I set both the supported input mime type format to all/all and output
format all/all. Then I click 'edit command' and set the command to
autolf.pl %filterinput %filteroutput. I set input from File to %in and
pipe to -. I set the output the same.
I put this script in /usr/bin and before it does anything (like command
line validation) it logs that it has run. I never see this happening.
Now, I know that the real solution is to fix the application, but
unfortunately the BASIC programs that our interpreter is going to
'execute' have been compiled (actually just pre-tokenized) and we don't
have easy access to the BASIC source. So previous BASIC programmers have
created some of the programs to use proper EOL termination, and some
don't ( I guess depending on what kind of print software was installed
on the SCO system and the make/model of target printer). So my script
here is ideal - it just strips ANY EOL characters and puts the right
ones on for the target printer. I would really like to get this firing
for EVERY print job to a particular printer. Is this possible?
Thanks for any help..
Tim
More information about the cups
mailing list