Bug 690243 - Problem converting PDF to PDF
Summary: Problem converting PDF to PDF
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: Macintosh MacOS X
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-20 14:05 UTC by Marcos H. Woehrmann
Modified: 2009-01-21 14:26 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Bug690178.pdf (1.35 KB, application/pdf)
2009-01-20 14:06 UTC, Marcos H. Woehrmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2009-01-20 14:05:22 UTC
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
Comment 1 Marcos H. Woehrmann 2009-01-20 14:06:02 UTC
Created attachment 4742 [details]
Bug690178.pdf
Comment 2 Marcos H. Woehrmann 2009-01-20 14:07:26 UTC
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. 
Comment 3 Alex Cherepanov 2009-01-20 16:05:24 UTC
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
Comment 4 Ken Sharp 2009-01-21 00:22:40 UTC
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.
Comment 5 Ray Johnston 2009-01-21 06:57:08 UTC
Alex, please go ahead and fix the file and commit it. The regression testing
will pick up the fixed file.
Comment 6 Alex Cherepanov 2009-01-21 14:26:08 UTC
The patch to the sample file is committed as a rev. 3180.