Leading Zero and Resolution in Output file name
Posted: 2018-03-03T15:28:37-07:00
Hi,
i use this script to convert pdf files into several images files:
IM writes the width and the height of in INPUT in the output file name, but what i need is the width and hight of the output files. how can i do this?
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
the output file name is
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