i use this script to convert pdf files into several images files:
Code: Select all
convert -density 300x300 -units pixelsperinch input.pdf -background white -alpha background -alpha off -resize 25% -compress jpeg +adjoin -set filename:mysize '%s_%G' "output_%[filename:mysize].tif"
IM also writes the page numbers to the output file name, starting with 0 and without leading zeros. is there any way to add leading zeros depending on the the number of pages of the input file? if the pdf has more then 10 but less then 100 pages with 0 leading zero and more then 100 pages with two leading zeros?
without the width/height in the file name i would do this with "-%02d" but i seems this doesn't work together. when i try this
Code: Select all
+adjoin -set filename:mysize '%G' "output_-%02d_%[filename:mysize].tif"
Code: Select all
output_-00_%[4944x6942.tif