LinuxUOS v20实测下批量图片转PDF
-
-
-
-
-
-
-
name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
-
stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
-
]>
-
<!--
-
Configure ImageMagick policies.
-
-
Domains include system, delegate, coder, filter, path, or resource.
-
-
Rights include none, read, write, execute and all. Use | to combine them,
-
for example: "read | write" to permit read from, or write to, a path.
-
-
Use a glob expression as a pattern.
-
-
Suppose we do not want users to process MPEG video images:
-
-
<policy domain="delegate" rights="none" pattern="mpeg:decode" />
-
-
Here we do not want users reading images from HTTP:
-
-
<policy domain="coder" rights="none" pattern="HTTP" />
-
-
The /repository file system is restricted to read only. We use a glob
-
expression to match all paths that start with /repository:
-
-
<policy domain="path" rights="read" pattern="/repository/*" />
-
-
Lets prevent users from executing any image filters:
-
-
<policy domain="filter" rights="none" pattern="*" />
-
-
Any large image is cached to disk rather than memory:
-
-
<policy domain="resource" name="area" value="1GP"/>
-
-
Define arguments for the memory, map, area, width, height and disk resources
-
with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
-
for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
-
exceeds policy maximum so memory limit is 1GB).
-
-
Rules are processed in order. Here we want to restrict ImageMagick to only
-
read or write a small subset of proven web-safe image types:
-
-
<policy domain="delegate" rights="none" pattern="*" />
-
<policy domain="filter" rights="none" pattern="*" />
-
<policy domain="coder" rights="none" pattern="*" />
-
<policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
-
-->
-
<policymap>
-
<!-- <policy domain="system" name="shred" value="2"/> -->
-
<!-- <policy domain="system" name="precision" value="6"/> -->
-
<!-- <policy domain="system" name="memory-map" value="anonymous"/> -->
-
<!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
-
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
-
<policy domain="coder" rights="read | write" pattern="PDF" />
-
<policy domain="resource" name="memory" value="256MiB"/>
-
<policy domain="resource" name="map" value="512MiB"/>
-
<policy domain="resource" name="width" value="16KP"/>
-
<policy domain="resource" name="height" value="16KP"/>
-
<!-- <policy domain="resource" name="list-length" value="128"/> -->
-
<policy domain="resource" name="area" value="128MB"/>
-
<policy domain="resource" name="disk" value="1GiB"/>
-
<policy domain="coder" rights="none" pattern="MVG" />
-
<!-- <policy domain="resource" name="file" value="768"/> -->
-
<!-- <policy domain="resource" name="thread" value="4"/> -->
-
<!-- <policy domain="resource" name="throttle" value="0"/> -->
-
<!-- <policy domain="resource" name="time" value="3600"/> -->
-
<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
-
<!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
-
<!-- <policy domain="delegate" rights="none" pattern="HTTPS" /> -->
-
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
-
<!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
-
<!-- <policy domain="cache" name="synchronize" value="True"/> -->
-
<!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
-
<!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
-
<!-- <policy domain="system" name="shred" value="2"/> -->
-
<!-- <policy domain="system" name="precision" value="6"/> -->
-
<!-- not needed due to the need to use explicitly by mvg: -->
-
<!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
-
<!-- use curl -->
-
<policy domain="delegate" rights="none" pattern="URL" />
-
<policy domain="delegate" rights="none" pattern="HTTPS" />
-
<policy domain="delegate" rights="none" pattern="HTTP" />
-
<!-- in order to avoid to get image with password text -->
-
<policy domain="path" rights="none" pattern="@*"/>
-
<!-- disable ghostscript format types -->
-
<policy domain="coder" rights="none" pattern="PS" />
-
<policy domain="coder" rights="none" pattern="PS2" />
-
<policy domain="coder" rights="none" pattern="PS3" />
-
<policy domain="coder" rights="none" pattern="EPS" />
-
-
<policy domain="coder" rights="none" pattern="XPS" />
-
<policy domain="coder" rights="read|write" pattern="LABEL" />
-
</policymap>
安装软件包
-
sudo apt install imagemagick
-
-
convert *.png out.pdf
然后可能会报错,直接修改/etc/ImageMagick-6下面的policy.xml文件为最上面的内容,其实可以检查一下,PDF哪些权限然后修改就好了。如果文件名比较有规律,生成的PDF内容也是前后顺序,很不错。
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhgfafgb
系列文章
更多
同类精品
更多
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
怎样阻止微信小程序自动打开
PHP中文网 06-13 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01