Scaling various images to A4 size including borders
Posted: 2019-08-21T07:22:26-07:00
Hi!
I am trying to scale and rotate various images to A4 size, then convert them to PDF and print them. But it does not work in any way reliable. Sometimes the images are printed as expected, sometimes they are rotated if not necessary. Most of the time the images are positioned with their left upper corner within the center of the page. Whatever I try it does not lead to what i'd like to have:
Most of the time I get:
https://drive.google.com/file/d/1mTR5zZ ... sp=sharing
Any idea how I could get what I want: this image centered with a border of 1cm on A4 paper?
I am trying to scale and rotate various images to A4 size, then convert them to PDF and print them. But it does not work in any way reliable. Sometimes the images are printed as expected, sometimes they are rotated if not necessary. Most of the time the images are positioned with their left upper corner within the center of the page. Whatever I try it does not lead to what i'd like to have:
- make them portrait: shorter sides top and bottom, longer sides left and right.
- scale them to fit on A4, respecting borders all 1cm.
Code: Select all
/usr/bin/convert "file.png" -verbose -strip -background white -rotate "90>" -trim +repage -page "A4<" -gravity "center" -resize "98%>" PDF:file.pdf
https://drive.google.com/file/d/1mTR5zZ ... sp=sharing
Any idea how I could get what I want: this image centered with a border of 1cm on A4 paper?