Need to pass document filename to filters
Kurt Pfeifle
k1pfeifle at gmx.net
Fri Nov 2 20:17:40 PDT 2007
Dennis W. Tokarski wrote:
> Hi,
>
> Recently I've been handed a print system requirement that each page
> regardless of source format or destination printer shall have a footer
> and/or headers added showing various job properties--job id, page
> number, etc.
>
> Pretty much all of this is working by means of a filter inserted
> just after the pstops stage of the pipeline. It inserts the
> necessary postscript bits into the print stream to make the footer
> appear.
>
> However, one of the info items I'm supposed to include is the
> original document file name, but I don't see that it's available
> anywhere.
>
> The problem seems to be that if the print job originates from
> an application like a web browser, editor, or word processor--anything
> other than lp or lpr in fact--the filename arg is a null string.
There is no such thing as an "original document file name" when it
comes to CUPS printing.
There is only the "title" parameter (which is set by *some* applica-
tions to the same as the orginal file name). CUPS filters see that
parameter as argv[3]
For web browsers, the next-best thing after accepting what argv[3]
tells you, may be looking for the "%%Title:" line in the PostScript
file (and trying to strip what's not whanted from the URL). Attention,
Firefox uses that line also its font embedding parts!
> Sometimes the title winds up being the file basename, but that's
> hardly consistent.
>
> Does anyone here see any way to reliably pass the original document
> file name through to the filters? The CUPS servers is on an Ubuntu
> Feisty box and all jobs originate locally if that helps.
--
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH ..................... Hedelfinger Strasse 58
A RICOH Company ........................... D-70327 Stuttgart/Germany
More information about the cups
mailing list