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

Vincent Farget farget.vincent at orange.fr
Fri Nov 21 05:16:03 PST 2014


Thank you very much for your answer.

I can mention that I do not use SAMBA server for Windows printing.
The few Windows client use the IPP (http://server:631/printers/canon) to 
access to the CUPS print queue.

I just found the site "OpenSuse" you mentioned below.
I am currently reading the pages you mentioned and other ones.

I am looking if I can develop a simple filter in PHP or PERL language 
(the langage that I understand) than can just add the value of the "ID 
user/service/departmen" in the postcript job which arrive from the 
Windows client.... ;-)

I don't know how difficult is it .... :-(

Best regards.
Vincent FARGET.

Johannes Meixner a écrit :
> 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

M. FARGET Vincent
Institut Camille Jordan - CNRS
Universite Claude Bernard LYON 1
Systemes Informatiques et developpements webs

More information about the cups mailing list