[Python] Fit multiple png´s optimally on a DinA4 PDF using ImageMagick (or python) on Mac

Discussão em 'Python' iniciado por Stack, Março 12, 2025.

  1. Stack

    Stack Membro Participativo

    I have a bunch of png´s in a folder, which I want to print out. Each of them is 640x960 pixels big and should be 6.7x10cm when printed out. I used to put every picture in Word, specify the size and then print them out.

    Because I have to do that task repeatedly I want to automate it. I found ImageMagick and installed it on my Mac. However I don't seem to get the dimensions quite right.

    I tried:

    montage -geometry 1181x792+50+50 -page 2480x3508 -density 300 -adjoin *.png output.pdf


    But the pictures don't have the right dimensions if printed out. A nice Bonus would be to find an optimal way to mimize white space on the A4 Page. I can fit one more pic in Word if I rotate it.

    A python solution would also be fine if anyone has ideas! thank you!

    Continue reading...

Compartilhe esta Página