lpadmin -p myprinter -E -v parallel:/dev/lp
#!/bin/bash shift;shift;shift;shift;shift cat $* echo -e "\f\c"Let's say we called that script "/tmp/myff". We add it to the raw printer like this:
lpadmin -p myprinter -E -i /tmp/myff -v parallel:/dev/lpYOU CAN ONLY USE SYS V INTERFACES SCRIPTS WITH RAW PRINTERS. No PPD files will be used, no other filters will be processed. This script will be the ONLY thing your data passes through.
date | lp -d myprintera form feeed will be added.
17 root (stdin) 1 /var/spool/cups/d00017-001
Obviously, there's much more that you can do at this level - emailing, data transformation, whatever you need. However, for complicated tasks, the cups filtering system does have advantages, so this method should be reserved for the simple cases.
See also foomatic,magicfilter
CUPS print to file - the hard way!
What are printer interface scripts?
/Unixart/cups_sysv_interface.html copyright All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Sun Oct 16 23:26:15 2005: Subject: bruceg2005
When you add /tmp/myff, this is at the creation of the printer. Is it possible to add a filter to an existing printer?
- Bruce
Mon Oct 17 09:18:30 2005: Subject: TonyLawrence
Not likle this, no. SysV filters are all or nothing. A "backend" filter is a little more complicated, but can be added to any printer (well, not a SysV style, but any ordinary cups printer).
But as I said in various places here, cups is complicated. Sometimes that's good, but it has a steep learning curve.
Mon Oct 17 13:51:39 2005: Subject: bruceg2004
I purchased the ESP Print Pro version (by the writers of CUPS) - http://www.easysw.com - and they have some good bulletin boards for asking questions. I have already made some suggestions, which the author will incorporate into PrintPro 5.
The one thing I like about the "Pro" version of CUPS, other than the support system, is the graphical front end to 'lp', called 'glp'. This gives you more of a "Windows" type of print dialog for your jobs, which is greatly needed. Although KDE has a very nice interface, this is even more complete.
I will ask the support system what the easiest way to do what I am asking is, and post back here. The author is the one who answers the majority of support questions, which is nice. Usually, within 24 hours.
- Bruce
Mon Jul 2 17:35:21 2007: Subject: TonyLawrence
I just had someone unable to do this - problem was the same as described at http://aplawrence.com/Bofcusm/1613.html
Don't use Windows to write your scripts!!!
Fri Aug 14 23:45:25 2009: Subject: Doing the opposite... Marcelo
Hi there... I got the inverse problem you'd described in your example.
I receive print jobs from a mainframe via LPD. And it worked pretty well in my old Conectiva 8.0 (Brazilian Distro). But it crashes... then I'm trying Ubuntu 9.04 (yes I know it's pretty fresh).
The problem is that cups-lpd, the work-around for cups listen on port 515 an receive LPD jobs, adds a #$#$#$&% form feed at every job.
The epson FX-890, responsible to the hard work is printing a blank page at each job, thus wasting a lot of paper.
I'm scrutinizing the Internet to fix that, and I refuse to go back to Conectiva 8.0 - it's a honor matter :-) !
So I've found your page...
May I do a script to remove that form feed?
Any ideas?
Thanks in advance,
Marcelo
Sat Aug 15 02:18:05 2009: Subject: TonyLawrence
That's in the printcap file.
Add ":sf:" to suppress formfeed.
Sat Aug 15 14:05:29 2009: Subject: Ubuntu overrides printcap Marcelo
Yes I know "sf" do the magic, the problem is, at least in Ubuntu 9.04, that the /var/run/cups/printcap is written by cups itself, and any changes you make on it are lost. The /etc/printcap is of no use, all CUPS uses is the /etc/cups/ppd/myprinter.ppd.
Heeeeeeeeelp!
OS X PDF e-books
Inexpensive, instant download
Sat Aug 15 14:12:05 2009: Subject: oops Mabafu
Oooops...
Nevermind
https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/251458
Tks anyway for your attention!
[]s
Marcelo
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar