|
From: <lud...@la...> - 2007-10-09 08:26:15
|
Hi, Ethan Merritt <merritt@u.washington.edu> writes: > On Friday 05 October 2007 02:36, Ludovic Courtès wrote: >> Hi, >> >> Just in case you missed it, I recently posted a tiny patch to disable >> PDF docinfo output for EPS: >> >> http://article.gmane.org/gmane.comp.graphics.gnuplot.bugs/1316 > > I consider the current gnuplot behaviour to be correct. > The pdfmark constuct allows passing metadata through to PDF, and > Adobe's PDF Reference, Third Edition states (Section 9): The problem is not with PDF, but rather with the interpretation of the `pdfmark' operator by "distiller" applications such as ps2pdf: the "pdfmark Reference Manual" [0] does not specify how multiple instances of an "Info dictionary pdfmark" should be handled. Consider the following PostScript file: %!PS-Adobe-3.0 %%DocumentMedia: A4 595 842 0 white () %%PageOrder: Ascend %%LanguageLevel: 2 %%BoundingBox: 0 0 595 842 [ /Title (First Title) /Author (First Author) /Subject (First Subject) /DOCINFO pdfmark [ /Title (Second Title) /Author (Second Author) /Subject (Second Subject) /DOCINFO pdfmark With GhostScript's ps2pdf and `pdfinfo' from Xpdf, I get this: $ ps2pdf ,,t.ps $ pdfinfo ,,t.pdf Title: Second Title Subject: Second Subject Author: Second Author Producer: GPL Ghostscript 8.56 CreationDate: Tue Oct 9 07:54:12 2007 ModDate: Tue Oct 9 07:54:12 2007 Tagged: no Pages: 1 Encrypted: no Page size: 595 x 842 pts (A4) File size: 2275 bytes Optimized: no PDF version: 1.4 Which means that the second Info dictionary overrode the first. Same result with Acrobat Distiller: $ pdfinfo ,,t.acrobat-distiller-7.pdf Title: Second Title Subject: Second Subject Author: Second Author Producer: Acrobat Distiller 7.0.5 pour Macintosh CreationDate: Tue Oct 9 09:56:34 2007 ModDate: Tue Oct 9 09:56:34 2007 Tagged: no Pages: 1 Encrypted: no Page size: 612 x 792 pts (letter) File size: 5057 bytes Optimized: yes PDF version: 1.4 Indeed, both PDF files only contain the second Info dictionary. Including a GNUplot-generated EPS file in a PS file that already contains its own Info dictionary marker is likely to lead to the same situation, unless the PS file is arranged such that its Info dictionary marker appears after the embedded EPS file. It turns out that both LaTeX+hyperref and Lout (which is what I use) put their Info dictionary marker at the beginning of the PS document; thus, that Info dictionary gets overridden by the one present in the included GNUplot-generated EPS files. QED. Furthermore, I question the usefulness of `pdfmark' in EPS files. EPS files are meant to be embedded, as the name implies, and probably not converted to PDF. Thus, `pdfmark' instances within EPS appear to be of little use; `pdfmark' in *PS* files, OTOH, are admittedly useful, and my patch preserves them. Thanks, Ludovic. [0] http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/pdfmarkReference.pdf |