Multi-page PDF to PNG

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
shamalamastreetman
Posts: 3
Joined: 2017-02-02T10:22:00-07:00
Authentication code: 1151

Multi-page PDF to PNG

Post by shamalamastreetman »

I just installed ImageMagick because I need to convert a multi-page PDF into individual PNG files. Right now using GIMP of PS batch commands isn't doing the trick. I'm new to IM and I noticed that on windows, the convert command is for drive management. Is there a different exe windows users run for this?

I also would like to set the destination resolution, so after reading quite a few posts, I amg guessing that my parameters will be

something.exe -density 300 file.pdf -scale 825x1125 .\test\output-%d.png

would this be correct?

edit: just to add, I have installed ImageMagick-7.0.4-5-Q16-x64-dll.exe
and have run the test:
magick logo: logo.gif
magick identify logo.gif
magick display logo.gif
everything seems to be ok
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multi-page PDF to PNG

Post by fmw42 »

try

Code: Select all

convert.exe -density 300 file.pdf -scale 825x1125 .\test\output-%d.png
But be sure you are using the IM convert.exe and not the Window convert.exe. Many IM Windows users rename the IM convert.exe to something like IMconvert.exe.

What is your IM version? If you are using IM 7, then change convert.exe to magick.exe
shamalamastreetman
Posts: 3
Joined: 2017-02-02T10:22:00-07:00
Authentication code: 1151

Re: Multi-page PDF to PNG

Post by shamalamastreetman »

The only binaries that I have in the folder are:
dcraw.exe
ffmpeg.exe
hp2xx.exe
imdisplay.exe
magick.exe

I haven't renamed anything yet since I haven't seen a convert.exe but it did cross my mind to do that.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Multi-page PDF to PNG

Post by snibgo »

shamalamastreetman wrote:something.exe -density 300 file.pdf -scale 825x1125 .\test\output-%d.png
Yes. For "something.exe" use "magick". No need to rename anything.

For "-scale", you might prefer "-resize".
snibgo's IM pages: im.snibgo.com
shamalamastreetman
Posts: 3
Joined: 2017-02-02T10:22:00-07:00
Authentication code: 1151

Re: Multi-page PDF to PNG

Post by shamalamastreetman »

thanks for the super quick answers!
Last edited by shamalamastreetman on 2017-02-02T10:54:48-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multi-page PDF to PNG

Post by fmw42 »

OK, You have IM 7, so

First try

Code: Select all

magick.exe -version
That will show you the version of IM and the delegate libraries to be sure you can process PDF, JPG, PNG, TIFF etc. Show me what you have.

Then try

Code: Select all

magick.exe -density 300 file.pdf -resize 825x1125 .\test\output-%d.png
-resize is better than -scale. The latter will do block averaging and be more blurry.


For new users, see the following references:
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/

For IM 7, in these documents, where it uses "convert", you should use "magick". If you need mogrify, montage, identify, etc, then use "magick.exe identify ...." etc. That is preface all the others with magick first.

Sorry, I am not a Windows user and so do not know much about Windows syntax.

See
http://www.imagemagick.org/Usage/windows/

For IM 7 vs IM 6, see
http://imagemagick.org/script/porting.php#cli
Post Reply