The attached PDF file gives a typecheck in run error when opened with gshead (r9086), gs8.54, os gs8.63. Acrobat 8.0 and Apple Preview open this file without problem. The command line I'm using: bin/gs -sDEVICE=tiff24nc -o test.tif ./3979782.PDF The output from PDFDEBUG: marcos@imac:[17]% gsheadtiff -dPDFDEBUG 3979782.PDF GPL Ghostscript SVN PRE-RELEASE 8.64 (2008-08-02) Copyright (C) 2008 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. **** Warning: File has a corrupted %%EOF marker, or garbage after %%EOF. << /Linearized 1 /O 6 /H [ 593 152 ] /L 6927 /E 5491 /N 1 /T 6730 >> **** Warning: An error occurred while reading an XREF table. **** The file has been damaged. This may have been caused **** by a problem while converting or transfering the file. **** Ghostscript will attempt to recover the data. << /Size 13 /Info 2 0 R /Root 5 0 R /Prev 6721 /ID [ (\004p'\311\353\323\321Vo\000\3149\253\036\t\201) (w*\231LdX$\321\355>3\346\301\210\377\223) ] >> %Resolving: [5 0] << /Type /Catalog /Pages 1 0 R /Metadata 3 0 R >> endobj %Resolving: [1 0] Error: /typecheck in --run-- Operand stack: --nostringval-- --nostringval-- 1 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push - -nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1830 1 3 %oparray_pop 1829 1 3 %oparray_pop 1813 1 3 %oparray_pop --nostringval-- -- nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- Dictionary stack: --dict:1142/1684(ro)(G)-- --dict:1/20(G)-- --dict:74/200(L)-- --dict:74/200(L)-- -- dict:106/127(ro)(G)-- --dict:277/300(ro)(G)-- --dict:20/25(L)-- --dict:1/10(L)-- Current allocation mode is local GPL Ghostscript SVN PRE-RELEASE 8.64: Unrecoverable error, exit code 1 marcos@imac:[18]%
Created attachment 4395 [details] 3979782.PDF
The PDF file is incorrect. It ends in %%E instead of %%EOF . We need a more robust PDF recovery routine because Acrobat can display PDF files even without %%EOF .
Search for 'startxref' instead of '%%EOF' in PDF recovery code because '%%EOF' is mangled more ofthen than 'startxref'. The following patch is committed as a rev. 9175. http://ghostscript.com/pipermail/gs-cvs/2008-October/008749.html Regression testing shows no differences.