PDF to JPG, ImageMagick, PHP and GS not playing nicely
Posted: 2009-09-22T02:58:24-07:00
I am trying to generate a jpg thumbnail image from the first page of a PDF. The error I get is:
My system set up is:
Windows XP SP 2 (win 32)
ImageMagic 6.5.6-Q16 (installed using win32 binary distribution)
GhostScript: gs815 (for win 32)
PHP 5
I am using phMagick to trap the errors, but if I use exec(), I get the same problem.
Investigation so far
1. PHP can execute. IUSER has access to cmd.exe.
2. Ghostscript is installed. I can see the entries in the registry (they point to the correct place) and if I use a third party viewer, I can view PDFs.
3. The command line works. If I take just the command line from inside the php exec() call, the image conversion works.
4. Configuration doesn't list any of the usual PS/GS/Postscript terms:
5. Added Ghostscript to windows path Environment variable. No effect.
6. Checked ImageMagic delegate.xml config and the @PSDelegate@ entries are there.
7. Uninstalled imagemagic and ghostscript and then reinstalled in different orders. No effect.
What should be my next step? What am I doing wrong?
All help kindly received!
Code: Select all
phMagick: Error executing "c:/progra~1/ImageMagick-6.5.6-Q16/convert "c:/inetpub/wwwroot/1km1kt/archive/equipmentindex7.pdf"[0] "c:/inetpub/wwwroot/1km1kt/archive/documents/destination.png""
return code: 1
command output :"convert: Postscript delegate failed `c:/inetpub/wwwroot/1km1kt/archive/equipmentindex7.pdf': No such file or directory @ pdf.c/ReadPDFImage/630.
convert: missing an image filename `c:/inetpub/wwwroot/1km1kt/archive/documents/destination.png' @ convert.c/ConvertImageCommand/2819."
Windows XP SP 2 (win 32)
ImageMagic 6.5.6-Q16 (installed using win32 binary distribution)
GhostScript: gs815 (for win 32)
PHP 5
I am using phMagick to trap the errors, but if I use exec(), I get the same problem.
Investigation so far
1. PHP can execute. IUSER has access to cmd.exe.
2. Ghostscript is installed. I can see the entries in the registry (they point to the correct place) and if I use a third party viewer, I can view PDFs.
3. The command line works. If I take just the command line from inside the php exec() call, the image conversion works.
4. Configuration doesn't list any of the usual PS/GS/Postscript terms:
Code: Select all
C:\PROGRA~1\ImageMagick-6.5.6-Q16>convert -list configure
Path: C:\Program Files\ImageMagick-6.5.6-Q16\config\configure.xml
Name Value
-------------------------------------------------------------------------------
CC vs8
COPYRIGHT Copyright (C) 1999-2009 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
HOST windows-unknown-linux-gnu
LIB_VERSION 0x656
LIB_VERSION_NUMBER 6,5,6,1
NAME ImageMagick
RELEASE_DATE 2009-09-15
VERSION 6.5.6
WEBSITE http://www.imagemagick.org
Path: configure.xml
Name Value
-------------------------------------------------------------------------------
CC vs8
COPYRIGHT Copyright (C) 1999-2009 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
HOST windows-unknown-linux-gnu
LIB_VERSION 0x656
LIB_VERSION_NUMBER 6,5,6,1
NAME ImageMagick
RELEASE_DATE 2009-09-15
VERSION 6.5.6
WEBSITE http://www.imagemagick.org
6. Checked ImageMagic delegate.xml config and the @PSDelegate@ entries are there.
7. Uninstalled imagemagic and ghostscript and then reinstalled in different orders. No effect.
What should be my next step? What am I doing wrong?
All help kindly received!