When using this command on PDFs larger than about 600KB
<? passthru("convert -verbose -scale '200x200+0+0>' ".$pdf."[0] $image"); ?>
I get this error output:
ERROR: /rangecheck in resolveR
Operand stack:
PageCount 4763294 47 46
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-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1129/1686(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- --dict:107/200(L)-- --dict:104/127(ro)(G)-- --dict:241/347(ro)(G)-- --dict:16/24(L)--
Current allocation mode is local
Anyone have a workaround for these larger files? I need to pull a page 1 thumbnail from some as large as 4 MB.
Per Kurt below I also tried accessing gs directly:
<?
$image = "3.jpg";
$pdf = '3/ABS_Survey_for_Load_Lines_CIB_100.pdf';
if (!file_exists($image)) {
echo passthru("gs \
-sOutputFile=$image \
-sDEVICE=jpeg \
-g200x200 \
-dPDFFitPage \
$pdf");
}
?>
This gives same error:
ESP Ghostscript 815.02 (2006-04-19)
Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
ERROR: /rangecheck in resolveR
Operand stack:
PageCount 4763294 47 46
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-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1122/1686(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- --dict:107/200(L)-- --dict:104/127(ro)(G)-- --dict:241/347(ro)(G)-- --dict:16/24(L)--
Current allocation mode is local
Bad news! I was playing with an online converter using a problem PDF and it gave a “bad pdf” error. All of the PDFs will open in Acrobat mind you but- I took some of the problem ones and re-saved them using my Acrobat 9 and lo and behold the thumbnails got created no problem…
So the issue had to do with whatever software the shipyard used to make the PDFs.