Page 1 of 1

Re: need help with mogrify numbering

Posted: 2008-11-10T16:33:46-07:00
by anthony
I don't think it is posible with mogrify. At least not at this time.
There are proposals however that would make this posible.
But you could try...

Code: Select all

 convert -density 300 doc.pdf  image-%02d.jpg
Or for a slower but better looking result...

Code: Select all

convert -density 1200 doc.pdf  -resize 25% image-%02d.jpg

Re: need help with mogrify numbering

Posted: 2008-11-10T16:36:29-07:00
by fmw42
mlanemartin wrote:I am not very experienced using command lines, if a program has a GUI I usually go with that. However, after much Googling and searching through this forum, I have finally come up with a command line that ALMOST does exactly what I want it to. I am trying to batch convert a folder of PDFs to JPGs. What I have come up with is:

mogrify -density 300 -format jpg *.pdf

However the outfile filenames for pages 1 through 9 were: image-0.jpg, image-1.jpg, image-2.jpg, etc.

I wanted the filenames to be: image-00.jpg, image-01.jpg, image-02.jpg, etc.

I found a forum entry on adding a preceding zero using the convert command, which is how I came up with this:

mogrify -density 300 -format -%02d.jpg *.pdf

This is almost perfect except I get an error code:

"mogrify: unable to open image '-%02d.jpg:': Invalid argument.

Despite this error message, the conversion still works, but the resulting filenames are: image.-00.jpg, image.-01.jpg, image.-02.jpg, etc.

I was wondering if there is a way for me to get the filenames without the extra period in there. So:

image.-00.jpg

would instead be:

image-00.jpg

Does anyone have any ideas on how to do this?

Thanks,
Michael

If this is a single pdf file, then there is no need for mogrify. Try the following:

convert image.pdf image-%02d.jpg

For an 9 page pdf, I get image-00.jpg ... image-08.jpg

Re: need help with mogrify numbering

Posted: 2008-11-10T17:15:59-07:00
by anthony
If you want to start at 1 rather than 0 add -scene 1

see IM Examples, Writing Multiple Image sequence
http://www.imagemagick.org/Usage/files/#write_seq