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
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.
Add missing dereferencing of indirect /Names and /Nums attributes. See: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=6116f7e9633c7c112c09c048b317de34c060ba5b
Thanks! The patch fixed the problem.