Generate tiles for all pages of multi-page PDF
Posted: 2019-10-14T08:21:56-07:00
Hi
Apologies if this is a common question; I can't seem to find this in the forums.
I'm trying to generate tiles for all pages of a PDF, and to name them according to the tile coordinates (the format should be something like <page_number>-<tile_column_number>-<tile_row_number>.jpg). So far I've come up with
Sadly, this only generates tiles for the first page of the PDF - hence the leading '0-' in the output filename. Any ideas for how I could generate tiles for all pages in the PDF and name them approrpriately?
Thanks!
Apologies if this is a common question; I can't seem to find this in the forums.
I'm trying to generate tiles for all pages of a PDF, and to name them according to the tile coordinates (the format should be something like <page_number>-<tile_column_number>-<tile_row_number>.jpg). So far I've come up with
Code: Select all
convert -density 300 input.pdf -colorspace RGB -flatten -quality 95 -crop 256x256 -set filename:f "0-%[fx:floor(page.x/256)]-%[fx:floor(page.y/256)]" '%[filename:f].jpg'
Thanks!