cups-pdf - problem with file names of exported pdfs

Kurt Pfeifle kurt.pfeifle at infotec.com
Wed Apr 4 08:54:50 PDT 2007


> MArcin wrote:
> > Hello
> > After few hours I have a running cups-pdf. Everything is ok but:
> >
> > When I "print" in output folder appear a pdf file but it's name is "job_19-untitled_document.pdf" instead "myfilename.pdf" (where myfilename is for example myfilename.doc)
> >
> > Where can I change this behaviour?
> >
> > Marc
>
> The version of cups-pdf I have (it is from 2004, and not in productive use at our site)
> gets the filename from the %%Title: comment of the PostScript job. If there
> is none, or the title string contains "garbage" (i.e. stuff the program cannot parse),
> the program falls back to the file name you see.


An example for this may be if you print a web page from a browser. This will lead to s.th. like this in the PostScript file:

  %%Title: http://www.cups.org/newsgroups.php?gcups.general+v:29034

which is not a valid file name (because of the slashes).

It would probably be better if the filename was converted into something
like "http:__www.cups.org_newsgroups.php?gcups.general+v:29034" (i.e.
replace illegal characters by underscores) instead of saying "unknown" (unless the %%Title line indeed does contain unknown, or is empty).

To make it perfect, replace the characters which are illegal for Windows and Mac OS X file names as well (AFAIR, on Windows these: < > : " / \ |  are illegal, so above conversion would have to be "http___www.cups.org_newsgroups.php?gcups.general_v_29034" to make it a "portable" file name).

DISCLAIMER: don't rely on the details in the last paragraph (I quoted from memory); research yourself at MSDN.

--
Kurt Pfeifle
System & Network Printing Consultant -- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH - A RICOH Company ........ Stuttgart/Germany








More information about the cups mailing list