print filters


What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):



From - Mon Jan 10 15:25:24 2000
Xref: world comp.unix.sco.misc:113711
Path: world!newsfeed.mathworks.com!arclight.uoregon.edu!logbridge.uoregon.edu!nntp.upenn.edu!news.misty.com!shady!shady!not-for-mail
From: kbs=cusm@shady.com (Kevin Smith)
Newsgroups: comp.unix.sco.misc
Subject: Re: print filters
Date: 10 Jan 2000 11:20:37 -0500
Organization: ShadeTree Software, Inc.
Lines: 112
Sender: kevin@shady.com Message-ID: <85d0sl$a5k@shady.shady.com> References: <38797A88.423347FF@squonk.net>
NNTP-Posting-Host: localhost.shady.com
X-Mozilla-Status: 8010
X-Mozilla-Status2: 00000000


Hate these ads?



In article <38797A88.423347FF@squonk.net> "Brian K. White" <linut@squonk.net> writes:
>...
>
>NEXT
>created this filter description file for use with scoadmin or lpadmin:
>/tmp/ps2epson
>Input types: ps
>Output types: any
>Filter type: slow
>Command: /usr/spool/lp/bin/ps2epson
>
>NEXT
>tried both scoadmin and lpadmin
>in scoadmin-->printers-->printer manager
>I selected system-->filters-->new
>and added a new filter named "ps2epson" and entered filename "/tmp/ps2epson"
>It _seemed_ to like it. *shrug* the new filter is listed in the filters box,
>and if I select "examine" it shows me a copy of the description file I made.
>
>then I select the printer I want to use this filter with ("p4") and select
>"settings-->advanced-->content types"
>the only content type listed at first is "simple"
>I select "define new" and type in "ps", then select "add"
>now ps is listed in both the defined and supported boxes for printer p4
>
>at this point, as far as I can tell from the manual, I should be able to say
>lp -Tps -dp4 golfer.ps
>however when I do this I simply get a text printout of the ps file not the
>interpreted ps graphics
>
>I also tried the following:
>alburner:~# /usr/lib/lpfilter -x -f ps2epson
>alburner:~# /usr/lib/lpfilter -f ps2epson -F/tmp/ps2epson
>alburner:~# /usr/lib/lpadmin -p p4 -I ps,simple          
>alburner:~# /etc/init.d/lp stop
>Print services stopped.
>alburner:~# /etc/init.d/lp start
>Print services started.
>alburner:~# lp -Tps -dp4 /usr/local/share/ghostscript/5.10/examples/golfer.ps
>request id is p4-1247 (1 file)
>alburner:~#
>...



I've setup filters on Unixware but not exactly like you're doing but
I may have some insights.














First, I think the '-T<type>' may not be what you expect.  From the manual



    Tell the print service to print the request on a printer that
    supports files of the specified content type. If no printer accepts
    this type directly, a filter will be used to convert the file
    contents into an acceptable type. If the -r option is specified, a
    filter will not be used.



What I think this means is that -Tps will direct the request to a printer
that supports type ps (as you setup with 'lpadmin -I ps,simple'.  Since
you've declared that printer p4 accepts type ps it doesn't think it
needs to convert it.  The printer does not accept ps which is why you
need a filter invoked.


LOD Communications, Inc.



Try



    o Setup a filter with input type ps and output type epson
    o Setup p4 to accept types epson and simple.
      This way it will accept the filter output or a normal unspecified input.



Now when you invoke lp with -Tps the system will determine that no
printers will accept type ps directly but there is a filter that will
convert from ps to a type supported by the printer and, hopefully,
invoke the filter.









You could just leave the filter output type as 'any' and leave the
printer input type as just simple (or unspecified) and it would still
work but creating a type specific to the type of printer the request
will only work if directed at the right kind of printer.  I.e. you would
want the request to fail if you did something like (lp -dlaserjet -Tps)
when your ps filter generates epson output.



In may case on unixware I setup two filters



filter lff:
    input=simple, output=lff, type=slow
    (This filter strips leading blank pages and trailing blank lines and pages)



filter laserauto:
    input=lff, output=fbpcl, type=slow, options='MODES auto = -auto'
    (This filter includes setup commands for a laserjet printer and
     optionally (-auto arg) sets font and orientation based on the
     longest line in the printout)



printer testpcl:
    lpadmin -ptestpcl -Ifbpcl



printer testtext:
    lpadmin -ptesttext -Ilff



So now if you do a simple print to testtext (lp -dtesttext) the default
input mode is simple but the printer only accepts type lff so the 
simile->lff filter is invoked.



If you print to testpcl (lp -dtestpcl) the printer only accepts type fbpcl.
There is no filter for simple->fbpcl but there are filters simple->lff and
lff->fbpcl.  The system figurs this out and strings the filters together.



The mode option to the laserauto filter is specified with -yauto on the
lp line (lp -dtestpcl -yauto).  If a filter supports the mode specified
in the -y arg (auto in this case) it passes the associated argument to
the filter program (as specified in the Options: line in the filter spec.
-- 
Do two rights make | Kevin Smith, ShadeTree Software, Philadelphia, PA, USA
a libertarian      | 001-215-487-3811  shady.com,kevin   bbs.cpcn.com,sysop
                   | dvtug.org,kevins--Deleware Valley Transit Users Group








Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


Views for this page
Today This Week This Month This Year  Overall
1313178 1,121

/Bofcusm/230.html copyright 1997-2004 (various authors) 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.

Publishing your articles here

More:
       - Printing




Unix/Linux Consultants

Your ad here - $48.00 yearly!

http://www.vss3.com SCO/Caldera OpenServer, Unixware & Linux. Tarantella & Non-stop Clustering


http://echo3.net/ Unix/Linux Custom Applications, Web Hosting, C/C++ Programming Courses


larryi@ccamedical.com SCO OS5, Debian Linux, RedHat Linux, MySQL, Apache, AJAX development using dXport/dL4/Unibasic, Windows Connectivity, Sharing Resouces, Automation, Shell Scripting



Twitter
  • Nov 18 20:41
    I'll be out all day Wednesday the 19th, hard to reach even by phone. Leave a message and have patience.
  • Nov 18 10:07
    What am I doing? Not doing what I WANT to be doing! Oh, well, in every life a little work must fall..




card_image








Change Congress


Related Posts