For a project I am running ImageMagick to convert several images (all of the same size 960x570) into a single PDF.
The command I'm running is:
convert *.jpg pdf/export.pdf
Since the images are all the same size I expect each PDF page to be equal in size but this is not the case as you can see in the screenshot below:
This is bit annoying since I don't know how I can force the size of each PDF page to be the same.
I tested the PDF on both an android device, ubuntu pdf reader and adobe reader and they all show the different sizes.
Thanks for helping!
EDIT1: After testing out a few more things as suggested by Marc B and Basti I managed to put the same size on the JPG (uploaded) images.
The problem still persists with the images that are generated using webkit2png (Python script that converts a webpage/html file to an image). After trying (almost?) everything in the convert command I can't get these generated images to shop up properly in the PDF as you can see below:
Any help would be much appreciated!
I found the solution:
I needed to add the following options to convert the image saved from webkit2png:
-density 960x570 -units PixelsPerInch
I hope this helps other people out too in the future ;)
After a few seconds of using google, I found this:
-size <geometry> width and height of image
Example given by them:
$ convert -size 320x85 canvas:none -font Bookman-DemiItalic -pointsize 72 \
-draw "text 25,60 'Magick'" -channel RGBA -blur 0x6 -fill darkred -stroke magenta \
-draw "text 20,55 'Magick'" fuzzy-magick.png
http://www.imagemagick.org/script/convert.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With