我有一个pdf文件,我正在尝试删除白色边距。
我的Linux机器上有pdfcrop命令
所以我正在使用以下命令
pdfcrop --margin 5 input.pdf output.pdf
现在,当我查看pdf时,它删除了所有书签(或内容),并且我具有指向各个页面的链接,这些链接不再起作用。
在修改pdf时如何保持内容和链接的完整性
删除边距的最佳方法是使用pdfCropMargins https://pypi.org/project/pdfCropMargins/
安装:
pip install "pdfCropMargins" --upgrade
现在我们可以使用该命令pdf-crop-margins
以所需的方式裁剪pdf
我想裁剪所有页面,然后在四周添加6bp的边距。我可以做到
pdf-crop-margins -v -p 0 -a -6 input.pdf
-v : Verbose
-p : how much percentage of margin to be retained. We want the bounding box triming all the white margins on all sides. So say 0%
-a : Note: first -p is applied to create a bounding box.
IN this option it applies further on the bounding box after -p is applied. we can remove or add margin. Negative means add margin to the bounding box. So it will add 10bp all around after cliping
输出文件附有 _cropped
我检查了裁剪的文件,所有内容和链接均完好无损。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句