[cups] How to build and use my own CUPS filter.

Johannes Meixner jsmeix at suse.de
Fri Nov 21 04:37:12 PST 2014


Hello,

On Nov 21 12:53 Vincent Farget wrote (excerpt):
> If  I understand well the process of printing from Windows using CUPS server, 
> the Windows driver (Canon iR5055/iR5065 PS3 -> postcript specific CANON 
> driver) The program formats the print file from the program which call the 
> printer to a postcript format (transformation) and send it to the CUPS server 
> which does not modify it and send it to the printer.

Perhaps
https://en.opensuse.org/SDB:Printing_from_Windows_to_Linux
provides additional help in understanding the process
of printing from Windows to a Linux CUPS server.


> My questions are :
> 1.)
> Is it possible to tell CUPS to get the "windows postcript"
> print job into a  (or more) filter(s) ?

Yes.

Everything is possible because the CUPS filtering system
(i.e. what converts data as needed) is not hardcoded
but fully adaptable to any need.


> If the answer is yes, where this can be done ?

I think there is no general answer - al least I don't know one.
I think you need to develop your own specific filter for your particular
printing environment.


> 2.)
> Is there somebody who have a "good" HOWTO (documentation) to build
> and also  use our own CUPS filter ?

Hopefully
https://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS
provides sufficient help in understanding the CUPS filtering process
so that you can develop your own specific filter for your particular
needs in your particular environment.

The article is a bit old but in general it should still apply.

Adapting the default CUPS filtering system could
become a bit tricky.

First:
When the Windows clients submit printing data to the CUPS server
via the SMB protocol, then the recipient on the CUPS server
is not CUPS (i.e. the cupsd) but Samba and then Samba forwards
it to the cupsd.
Usually when Samba gets printing data from Windows clients
it forwards it explicitly marked as "raw" to the cupsd.
But "raw" data is not at all processed by the CUPS
filtering system, see
http://en.opensuse.org/SDB:Printing_from_Windows_to_Linux
In this case you need to change the Samba settings on the
CUPS server to no longer forward printing data from Windows
clients as "raw" so that the CUPS filtering system will be used.

Second:
Likely the default CUPS filtering system will not work correctly
for printer specific data that was made by a Windows driver.
In this case you need to adapt the default CUPS filtering system
according to your particular needs for your particular Windows
driver, see
http://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS

When the Windows driver produces printer specific PostSript
(probably together with a printer specific JCL header) and
you only need to modify it in a hardcoded way, it is relatively
easy because both PostSript and JCL are basically plain ASCII text
so that an appropriate "System V style interface script"
that calls 'sed' or whatever similar programs (e.g. 'awk')
should be sufficient for your particular needs.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany
HRB 21284 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer




More information about the cups mailing list