[cups.general] Need to pass document filename to filters

Michael Sweet msweet at apple.com
Fri Nov 2 18:23:26 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.
> 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.

The document-name attribute is passed in by the cupsPrintFile* APIs,
so if the underlying apps use this function then you'll be able to
get that.

However, most apps will be printing a temporary file whose name will
not bear any resemblance to the original document name.

The job-name attribute (which is passed in argv[3]) is often set to
either the basename or the document title, depending on how the job
is submitted (apps most often provide the document title, while the
command-line will supply the basename by default...)

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups mailing list