The Computer Oracle

Convert PDF to JPG images with ImageMagick - how to 0-pad file names?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: Techno Intrigue Looping

--

Chapters
00:00 Convert Pdf To Jpg Images With Imagemagick - How To 0-Pad File Names?
00:33 Accepted Answer Score 40
01:02 Thank you

--

Full question
https://superuser.com/questions/633698/c...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#imagemagick

#avk47



ACCEPTED ANSWER

Score 40


ImageMagick accepts format specifiers in its command line:

convert -density 600 foo.pdf foo-%02d.jpg

Quote from the doc:

Filename References

Optionally, use an embedded formatting character to write a sequential image list. Suppose our output filename is image-%d.jpg and our image list includes 3 images. You can expect these images files to be written:

image-0.jpg
image-1.jpg
image-2.jpg