Page 1 of 1

Receiving "Error: /syntaxerror in pdfopen" on pdf conversion

Posted: 2011-01-05T03:17:47-07:00
by DarkAngelBGE
Hi there,

I am new here and not all too familiar with ImageMagick. I ran into a problem, which I could not get any answers to via Google or the search function on this forum.

I simply want to convert the first page of a pdf file into a jpg image. Here is the command and its output:

convert -density 150 -quality 100 'mypdf.pdf[0]' test.jpg

Error: /syntaxerror in pdfopen
Operand stack:
(/tmp/gs_a4lF42) (\377\330\377\340\000\020JFIF\000\001\002\001\001M\001M\000\000\377\341\020\241Exif\000\000MM\000*\000\000\000\b\000\007\001\022\000\003\000\000\000\001\000\001\000\000\001\032\000\005\000\000\000\001\000\000\000b\001\033\000\005\000\000\000\001\000\000\000j\001\(\000\003\000\000\000\001\000\002\000\000\0011\000\002\000\000\000\036\000\000\000r\0012\000\002\000\000\000\024\000\000\000\220\207i\000\004\000\000\000\001\000\000\000\244\000\000\000\320\0002\317\320\000\000'\020\0002\317\320\000\000'\020Adobe Photoshop CS3 Macintosh\0002008:11:05 11:28:26\000\000\003\240\001\000\003...)
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:1161/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 8.70: Unrecoverable error, exit code 1
convert: Postscript delegate failed `mypdf.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
convert: missing an image filename `test.jpg' @ convert.c/ConvertImageCommand/2775.


Image Magick version:
Version: ImageMagick 6.5.1-0 2009-08-27 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Ghostscript Version:
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc. All rights reserved.

The pdf is an eBook with 400 pages which I cannot publish here unfortunately. : /

Re: Receiving "Error: /syntaxerror in pdfopen" on pdf conver

Posted: 2011-01-05T03:21:47-07:00
by DarkAngelBGE
Fyi, I also tried repairing the pdf first via pdftk:

pdftk mypdfpdf output fixed.pdf

Without luck. Still getting the same error on fixed.pdf.

Re: Receiving "Error: /syntaxerror in pdfopen" on pdf conver

Posted: 2011-01-05T14:58:18-07:00
by fmw42
Have you tried without the quotes? Just a thought. I suspect your GS install may be corrupt or missing the GS fonts library or you did not point IM to the GS fonts library. All things to double check. I am not an expert on any of this, but these are the main things that typically go wrong that I am aware of.