simple PDF to JPG convert help!!

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
alexcordero9
Posts: 7
Joined: 2013-01-16T15:59:04-07:00
Authentication code: 6789

simple PDF to JPG convert help!!

Post 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!!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: simple PDF to JPG convert help!!

Post 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
snibgo's IM pages: im.snibgo.com
alexcordero9
Posts: 7
Joined: 2013-01-16T15:59:04-07:00
Authentication code: 6789

Re: simple PDF to JPG convert help!!

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: simple PDF to JPG convert help!!

Post 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.
snibgo's IM pages: im.snibgo.com
alexcordero9
Posts: 7
Joined: 2013-01-16T15:59:04-07:00
Authentication code: 6789

Re: simple PDF to JPG convert help!!

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: simple PDF to JPG convert help!!

Post 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.
snibgo's IM pages: im.snibgo.com
alexcordero9
Posts: 7
Joined: 2013-01-16T15:59:04-07:00
Authentication code: 6789

Re: simple PDF to JPG convert help!!

Post 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!!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: simple PDF to JPG convert help!!

Post 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.
snibgo's IM pages: im.snibgo.com
alexcordero9
Posts: 7
Joined: 2013-01-16T15:59:04-07:00
Authentication code: 6789

Re: simple PDF to JPG convert help!!

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: simple PDF to JPG convert help!!

Post 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.
snibgo's IM pages: im.snibgo.com
alexcordero9
Posts: 7
Joined: 2013-01-16T15:59:04-07:00
Authentication code: 6789

Re: simple PDF to JPG convert help!!

Post 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.
metalcupid
Posts: 1
Joined: 2016-08-15T01:48:40-07:00
Authentication code: 1151

Re: simple PDF to JPG convert help!!

Post 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.
ubutar
Posts: 2
Joined: 2019-07-09T08:21:57-07:00
Authentication code: 1152

Re: simple PDF to JPG convert help!!

Post by ubutar »

7 years later (almost) this thread still solved my problem, old but gold, thank you, snibgo.
Post Reply