Page 1 of 1

Converting large pdf file fails

Posted: 2011-01-18T22:26:23-07:00
by siiva
I'm using imagemagick "convert" to convert pdfs to jpgs. Mostly it works great. But on larger files it seems to choke. My imagemagick version is:
Version: ImageMagick 6.5.1-0 2010-12-02 Q16 OpenMP http://www.imagemagick.org

Ghostscript version:
GPL Ghostscript 8.70 (2009-07-31)

This is the original command I used:

/usr/bin/convert -limit memory 0 -limit map 0 -density 150 -thumbnail 2000x2000 -verbose "/home/bnc/tmp.pdf[0]" jpeg:"/home/bnc/tmp.jpg"

Then I tried these variations:
convert -debug cache -limit memory 8192 -limit map 8192 -limit area 8192 -density 300 -compress zip /home/bnc/tmp.pdf /home/bnc/tmp.jpg

convert -debug cache -limit memory 0 -limit map 0 -limit area 0 -density 300 -compress zip /home/bnc/tmp.pdf /home/bnc/tmp.jpg

convert -debug cache /home/bnc/tmp.pdf /home/bnc/tmp.jpg

All of which produce this (see full error at the bottom):
convert: Postscript delegate failed `/home/bnc/tmp.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
convert: missing an image filename `/home/bnc/tmp.jpg' @ convert.c/ConvertImageCommand/2775.

Here is a link to the PDF:
http://67.23.3.232/tmp.pdf

Full error:
2011-01-19T04:57:03+00:00 0:01 0.000u 6.5.1 Cache convert[8543]: cache.c/DestroyPixelCacheInfo/1513/Cache
destroy
2011-01-19T04:57:03+00:00 0:01 0.010u 6.5.1 Cache convert[8543]: cache.c/DestroyPixelCacheInfo/1513/Cache
destroy
Error: /syntaxerror in pdfopen
Operand stack:
(/tmp/gs_IzhfhY) (<<\n /ASCII85EncodePages false\n /AllowTransparency false\n /AutoPositionEPSFiles true\n /AutoRotatePages /None\n /Binding /Left\n /CalGrayProfile \(Dot Gain 20%\)\n /CalRGBProfile \(sRGB IEC61966-2.1\)\n ...)
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1159/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:285/300(ro)(G)-- --dict:7/15(L)--
Current allocation mode is local
GPL Ghostscript GPL Ghostscript 8.708.70: : Unrecoverable error, exit code 1
Unrecoverable error, exit code 1
convert: Postscript delegate failed `/home/bnc/tmp.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
convert: missing an image filename `/home/bnc/tmp.jpg' @ convert.c/ConvertImageCommand/2775.