Bug 692502 - pdf2dsc gets a rangecheck error on a pdf created by gs
Summary: pdf2dsc gets a rangecheck error on a pdf created by gs
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 9.04
Hardware: PC Linux
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 01:49 UTC by William Bader
Modified: 2011-11-01 04:58 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
sample file to show the problem (332.86 KB, application/x-bzip2)
2011-09-16 01:49 UTC, William Bader
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Bader 2011-09-16 01:49:35 UTC
Created attachment 7882 [details]
sample file to show the problem

I have an eps file made by my application.
I ran ps2pdf to convert it to a pdf.
When I try to view the pdf with gv, gv gets errors because pdf2dsc fails.
With the attached file, run
bunzip2 < testcon.eps.bz2 > test.eps  
ps2pdf -dEPSCrop test.eps test.pdf
pdf2dsc test.pdf
Error: /rangecheck in --get--
I am using gs9.04 on Linux.

I think that it is due to the numoget call in pdf2dsc.ps when .hasPageLabels is true and it tries to extract a label from PageLabels.

The pdf has
1 0 obj
<</Type /Catalog /Pages 3 0 R
/PageLabels << /Nums  4 0 R >>
/MarkInfo<<
/Marked true
>>
/Metadata 36 0 R
>>
endobj

4 0 obj
[0 
<</P(1)>>]endobj 
36 0 obj
<</Type/Metadata 
/Subtype/XML/Length 1513>>stream

endstream
endobj
Comment 1 William Bader 2011-09-16 02:20:47 UTC
The generated pdf views correctly with gs-9.04, evince-2.32.0, xpdf-3.03, and acroread-9.4.2.

The eps crashes old versions of acrobat distiller due to the format of the CreationDate DOCINFO entry.  More recent versions of acrobat distiller process the file but produce a pdf with some text missing at the top.

If I remove the line
[ /Label (1) /PAGELABEL pdfmark
from the eps, then pdf2dsc doesn't get errors on the pdf.
Comment 2 Alex Cherepanov 2011-10-29 19:43:11 UTC
Add missing dereferencing of indirect /Names and /Nums attributes.

See:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=6116f7e9633c7c112c09c048b317de34c060ba5b
Comment 3 William Bader 2011-11-01 04:58:45 UTC
Thanks!  The patch fixed the problem.