首先,安装imagemagick

sudo apt install imagemagick

将多个图片合并到一个pdf文件

convert "*.{png,jpeg}" -quality 100 outfile.pdf
convert "IMG*.png" -quality 100 outfile.pdf

如果出现错误信息:
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF'
则修改相应权限。

 sudo vi /etc/ImageMagick-6/policy.xml


<policy domain="coder" rights="none" pattern="PDF" />
修改为
<policy domain="coder" rights="read|write" pattern="PDF" />

再执行

convert "IMG*.png" -quality 100 outfile.pdf
本文链接地址:https://const.net.cn/730.html

标签: none

添加新评论