[cups.development] XHTML Print format

Jon Peatfield J.S.Peatfield at damtp.cam.ac.uk
Mon Oct 15 15:03:39 PDT 2007

On Mon, 15 Oct 2007, Michael R Sweet wrote:

>> Not sure, but I think the answer is the texttops filter in the
>> mime.convs file, right?
>> /etc/cups/mime.convs file:
>> "text/html               application/postscript  33      texttops"
> That's the basic mapping - if you did your own filter or added the
> XHTML MIME type, just create vendor.types and vendor.convs files
> that point to your new filter and use a lower cost so that your
> filter is run instead of texttops.

I'd like to think that XHTML would have a different mime type but maybe 

Writing a simple wrapper round some external code so that it 
takes/processes the arguments that a CUPS filter gets isn't particularly 

We do this for text/plain with our filter calling a2ps for the actual 
conversion - in an effort to look more like our old (lpd-based) printing 
setup and so not to scare users when we switched to CUPS.

Apart from our text filter trying to do *very* evil things with duplex 
settings the only place we had any problems is that the docs claimed that 
the printer name is passed in as argv[0].  We don't get that but maybe it 
gets broken because our filter is a perl-script.  We do get passed PRINTER 
in the environment though so no loss there.

We also wrapper pstops to get it to doctor/clean the options received from 
some clients e.g. MacOSX, Windows and try to avoid some assumptions about 
paper-sizes - when doing page rotations.

Of course I'm still using CUPS-1.1.17 (from Redhat) for this so maybe 
things are different in a more current release.

  -- Jon

More information about the cups-devel mailing list