Add margin to PDF file when merging using PDFTK or similar

大憨熊 提交于 2019-12-03 03:00:39

If you use ubuntu, you can install pdfcrop:

sudo apt-get install -y pdfcrop

Despite its name, pdfcrop has the option to add margins:

pdfcrop --margin '29 0 29 0' input.pdf output.pdf

(Note: the unit is bp. 72 bp = 1 inch. 29 bp is approximately 1 cm.)

Then, use pdfjam to do the offset trick for the right and left pages.

pdfjam --twoside --offset '1cm 0cm' file.pdf

Note: pdfcrop does have problems with some pdf files. (!!! Error: Ghostscript exited with error code 139!).

If you are still interested in this, you should have a look at pdfjam which allows you to offset and clip pdfs. With respect to your particular question you might do something like

pdfjam --twoside --offset '2cm 0cm' file.pdf

This shifts the even pages 2cm to the right and the odd one to the left.
pdfjam is a front end to the pdfpages package of pdflatex.

user1635544

Even if it is a bit late, but it might help someone. In response to @ElkeSpaak comment, it's the package texlive-extra-utils:

dpkg-query -S /usr/bin/pdfcrop 
texlive-extra-utils: /usr/bin/pdfcrop
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!