Batch Converting PDFs to GIFs

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
Legal

Batch Converting PDFs to GIFs

Post by Legal »

I'm trying to batch convert the first page of a directory-full of PDFs into GIF files.

I'm using this command:

Code: Select all

mogrify -format pdf[0] *.gif
Unfortunately, this seems to do... nothing?

Any help would be greatly appreciated!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch Converting PDFs to GIFs

Post by fmw42 »

mogrify -format pdf[0] *.gif
You have the syntax backwards if you want to go from pdf to gif. Also you would be best to create a new directory and write to that directory rather than chance overwriting your original images.

This works:

# set up 3 test 3-page pdf images
convert rose: rose: rose: rose1.pdf
convert rose1.pdf rose2.pdf
convert rose2.pdf rose3.pdf
cd ROSE1
ls
rose1.pdf rose2.pdf rose3.pdf

mogrify -path /Users/fred/ROSE2 -format gif *.pdf[0]

The resulting gif images in directory ROSE2 are only 1 page.

OR you could try

mogrify -path /Users/fred/ROSE2 -format gif -scene 0 *.pdf
Legal

Re: Batch Converting PDFs to GIFs

Post by Legal »

fmw42! You are awesome, thank you!
Post Reply