I have a 1200×7200 pixels PNG, and I want to slice it into a multipage PDF, 8.5×11 inches, with 1 inch margins.
For convenice, here are the 8.5 and 11 inches in pixels:
Inches Pixels, at 72 PPI Pixels, at 300 PPI 8.5 612 2550 11 792 3300
I tried
# version 1
magick input.png -crop x3300 +repage -units PixelsPerInch -density 300 output.pdf
but it doesn’t leave margins.
Using trial and error, I came up to
# version 2
magick input.png -crop x2700 -repage 2550x3300+100+100 -units PixelsPerInch -density 300 output.pdf
but I cannot figure out why the text on the last page is moved to its bottom (to fix this, I tried to add -gravity center
, but this remove margins).
I also don’t understand why, to create margins, the value 100
works for me. Since I use -units PixelsPerInch
and -density 300
, I assume that 1 inch will be 300 pixels and not 100, but changing -repage 2550x3300+100+100
to -repage 2550x3300+300+300
makes the margins extremaly large.