I'm having problems turning a PDF into a TIFF (-sDEVICE#tiff24nc). The error I get is: AFPL Ghostscript 8.53 (2005-10-20) Copyright (C) 2005 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 1. Page 1 Error: /rangecheck in --.buildshading2-- Operand stack: --dict:10/10(L)-- 1 --dict:8/8(L)-- --dict:8/8(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- 38606 --nostringval-- 3 15 %oparray_pop --nostringval-- false 1 %stopped_push 3 15 %oparray_pop --nostringval-- (gstatetype) --dict:0/0(L)-- --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue 3 18 %oparray_pop --nostringval-- false 1 %stopped_push --nostringval-- Dictionary stack: --dict:1127/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:258/347(ro)(G)-- --dict:21/24(L)-- --dict:4/6(L)-- --dict:21/32(L)-- --dict:1/1(ro)(G)-- --dict:16/20(L)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:3/5(L)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:5/5(L)-- Current allocation mode is local AFPL Ghostscript 8.53: Unrecoverable error, exit code 1 I've seen mention of this error to do with Quark-generated PDFs before, but I don't think this is the case here. Acrobat Reader's Document Properties reports: Application: Adobe InDesign CS (3.0.1) PDF Producer: Adobe PDF Library 6.0 PDF Version: 1.3 (Acrobat 4.x) The document in question is around 600K and consists of a customer's artwork, so I'd rather not attach it to this report. Please contact me directly if it would help get to the cause of this problem.
Little can be done without the sample file. You can try to remove the sensitive parts of the document usung Adobe Acrobat. File attachments can be marked private. Private attachments can be accessed by a small number of Ghostscript developers who have a NDA with Artifex Software.
Created attachment 1850 [details] PDF causing the error
Created attachment 1851 [details] patch Some bounding boxes in the sample file have y0 > y1 . Normalize the BBox in the shading dictionary when needed.
Note: There are procedures called normrect and normrect_elems in lib/pdf_main.ps which will 'normalize' a rectangle.
Created attachment 1852 [details] improved patch A shorter patch that uses an existing function.
Ghostscript 8.53 with the improved patch works a charm! Many thanks for looking into this. Matt
Alex please commit the patch and close the bug.
The fix is committed to the HEAD branch.