Page 1 of 1

simple PDF to JPG convert help!!

Posted: 2013-01-16T16:11:00-07:00
by alexcordero9
Hello everyone--first posting here.. Please help, I'm under the gun here...

I nedd to convert hundreds of PDFs to JPEG and I'm getting this error message.

this is what I type (source:http://www.medicalnerds.com/batch-conve ... -software/)

Code: Select all

convert -density 300 432.pdf 432.jpg
and I get this:

convert.exe: `%s' (%d) "gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOP
ROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=
pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" "-sOutputFile=C:/
Users/d44399/AppData/Local/Temp/magick-4868p6hCJjEqjZaH" "-fC:/Users/d44399/AppD
ata/Local/Temp/magick-4868bZOiAzyKyvGx" "-fC:/Users/d44399/AppData/Local/Temp/ma
gick-4868KWF0SQaCXtfn" @ error/utility.c/SystemCommand/1890.
convert.exe: Postscript delegate failed `432.pdf': No such file or directory @ e
rror/pdf.c/ReadPDFImage/678.
convert.exe: no images defined `432.jpg' @ error/convert.c/ConvertImageCommand/3


I'm using Windows 7, the PDF is only one page. The PDF is in the same directory as convert.exe.
Please help, it seems so simple! Thanks!!

Re: simple PDF to JPG convert help!!

Posted: 2013-01-16T16:39:48-07:00
by snibgo
What version of ImageMagick? Type "convert -version".

What happens with these commands:

Code: Select all

identify 432.pdf

Code: Select all

dir 432.pdf

Re: simple PDF to JPG convert help!!

Posted: 2013-01-16T23:57:26-07:00
by alexcordero9
thanks for your response:

version:

Code: Select all

Version: ImageMagick 6.8.1-9 2013-01-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: OpenMP
Delegates: bzlib freetype jp2 jpeg lcms lzma ps tiff x xml zlib
When I type "identify" I get the same erroneous output.

dir 432.pdf returns the file type and size information that a directory listing would display.

Again, I'm using a 64bit Windows 7 machine

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T02:27:51-07:00
by snibgo
Hmm, okay, it's not the obviuous problem that the file isn't there. The next step (other than messing around with direct gswin commands, and I know nothing about those) is to put the file up somewhere like dropbox so other people can try to read it with other versions of IM and ghostscript.

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T11:52:41-07:00
by alexcordero9
unfortunately I can't disclose the file because I don't know if the drawing contains sensitive information--it may not but I don't want to take that risk. I've run the same command using other PDF files and all return the same error so, I don't think there's anything unusual about this particular file. The error message seems to indicate that it can't even find the PDF file--strange.

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T12:13:04-07:00
by snibgo
For the moment, don't worry about density etc.

From the generated command, you can see that IM uses temporary files. Maybe that's where the problem is. Do you have read/write access to "C:/Users/d44399/AppData/Local/Temp/" ?

Can you execute "gswin32c.exe"? On my machine, IM generates the full path, which is what I need to type on the command line. (If you get into ghostscript, type "quit" to exit.)

Did you install ghostscript before ImageMagick? That's the correct way. IM finds gs at installation.

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T15:05:11-07:00
by alexcordero9
Permissions have been a problem and I didn't know about the temp file thing. I'll test this again on a machine running Windows XP rather than 7. Although I don't think that that 7 is the problem, I have been hampered by permissions issues on the local level for reasons that not even our tech support has resolved. I'll test this XP and see if that's an issue--thanks!!

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T15:21:53-07:00
by snibgo
I'm also on Windows 7.

It's worth trying:

Code: Select all

echo Hello >C:/Users/d44399/AppData/Local/Temp/test.txt
type C:/Users/d44399/AppData/Local/Temp/test.txt
You should get "Hello" back. If it throws an error, that's the problem.

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T16:23:06-07:00
by alexcordero9
I got "Hello" back.

But I just realized something, I don't have "gswin32c.exe" anywhere. Ghostscript was not in the install, do I need it? How does that work?

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T16:59:00-07:00
by snibgo
IM uses GS to read PDFs. So you haven't installed ghostscript? Yeah, that would explain why IM fails when trying to execute gswin32.exe.

Re: simple PDF to JPG convert help!!

Posted: 2013-01-17T23:13:02-07:00
by alexcordero9
Ok... I got it, it's working! I had a host of other little security issues going on. Also, I didn't have GS installed. IM's a thing of beauty once all this is configured correctly. These are the steps I followed: (your mileage may vary)
Thanks for all your help.

Re: simple PDF to JPG convert help!!

Posted: 2016-08-15T01:52:26-07:00
by metalcupid
snibgo wrote:IM uses GS to read PDFs. So you haven't installed ghostscript? Yeah, that would explain why IM fails when trying to execute gswin32.exe.
Thank you snibgo.
Three years later.. your answer worked for me.
I was having trouble with the conversion just like alexcordero9, haven't installed Ghostscript.
Thanks to you, made it work.

Re: simple PDF to JPG convert help!!

Posted: 2019-10-10T11:50:41-07:00
by ubutar
7 years later (almost) this thread still solved my problem, old but gold, thank you, snibgo.