Page 1 of 1

Converting several .jpg into a multipage .pdf - with external margins

Posted: 2016-06-25T03:31:07-07:00
by floppyzedolfin
Hello,
Here is my situation : I have several .jpg files that have roughly the same size (360*510) that I would like to concatenate into a .pdf file so that I can print only one file and reduce the amount of non-printed pagespace.

In order to achieve this, I used montage :
montage -geometry 360x510+2+2 -mode concatenate -tile 3x3 *.jpg output.pdf

This does approximately what I want : it does generate a multipage .pdf file with, on each page, 9 of my .jpgs, with a small whitespace between them.

However, it has only 2 pixels inner margin on the sides, which isn't acceptable for print - I would need something like 2cms (let's make it simple and have the same margin on vertical and horizontal edges) on each side of my .pdf pages.
Is there any way I can achieve this with command-lines?

Thanks a lot!

Re: Converting several .jpg into a multipage .pdf - with external margins

Posted: 2016-06-25T05:36:13-07:00
by floppyzedolfin
It seems I found a way.
Relaunch a montage on the output.pdf file :

montage -geometry +50+50 -mode concatenate -tile 1x1 output.pdf outputEdges.pdf

this sort of does what I want.

Re: Converting several .jpg into a multipage .pdf - with external margins

Posted: 2016-06-25T10:39:35-07:00
by fmw42
You could have just added a border around the outside using -border

Re: Converting several .jpg into a multipage .pdf - with external margins

Posted: 2016-06-27T06:45:34-07:00
by floppyzedolfin
I did try the -border option, but it added a border to each of my .jpg files, and thus created wide borders within the pages, rather than on their borders.

Re: Converting several .jpg into a multipage .pdf - with external margins

Posted: 2016-06-27T09:08:24-07:00
by fmw42
You have to pipe the output from montage to a convert to add the border. It is similar to what you did with a second montage, but just using the simpler -border.