The attached file generates a /undefined in --run-- error when converted using -sDEVICE=pdwrite; using a raster device works. The command line I'm using for testing: bin/gs -sDEVICE=pdfwrite -o test.pdf ./Bug690178.pdf
Created attachment 4742 [details] Bug690178.pdf
Ken looked at this file and as the following comment: Bug690178.pdf is invalid, it has an Outlines dictionary with no /First or /Last entry and a /Count of 0. The spec says "This entry should be omitted if there are no open outline items. " I would guess that processing of /Outlines dictionaries doesn't happen except when the output device is pdfwrite (no point otherwise) and so the error only shows up in this case.
However, the error is caused by a different bug in the sample file. The file uses executable name instead of a literal name and Ghostscript cannot cope with this level of abuse. The sample file is, obviously, written by hand. I suggest to fix the sample file as following: E:\bug\690243>diff -u Bug690178.pdf hack.pdf --- Bug690178.pdf 2008-12-07 04:30:46.000000000 -0500 +++ hack.pdf 2009-01-20 18:56:58.000000000 -0500 @@ -6,7 +6,7 @@ >> endobj 2 0 obj - << /Type Outlines + << /Type/Outlines /Count 0 >> endobj
Heh, missed that one, thanks Alex. I guess that my supposition about /Outlines processing was correct though ? We only process it when pdfwrite is the selected device ? Marcos, not sure what you want to do about this, fix the file would seem most obvious solution.
Alex, please go ahead and fix the file and commit it. The regression testing will pick up the fixed file.
The patch to the sample file is committed as a rev. 3180.