Page 1 of 1
Batch Converting PDFs to GIFs
Posted: 2010-02-22T11:03:47-07:00
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:
Unfortunately, this seems to do... nothing?
Any help would be greatly appreciated!
Re: Batch Converting PDFs to GIFs
Posted: 2010-02-22T11:23:21-07:00
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
Re: Batch Converting PDFs to GIFs
Posted: 2010-02-22T11:45:43-07:00
by Legal
fmw42! You are awesome, thank you!