• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

LinuxUOS v20实测下批量图片转PDF

武飞扬头像
五块钱的方便面
帮助1

  1.  
    <?xml version="1.0" encoding="UTF-8"?>
  2.  
    <!DOCTYPE policymap [
  3.  
    <!ELEMENT policymap (policy) >
  4.  
    <!ATTLIST policymap xmlns CDATA #FIXED ''>
  5.  
    <!ELEMENT policy EMPTY>
  6.  
    <!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
  7.  
    name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
  8.  
    stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
  9.  
    ]>
  10.  
    <!--
  11.  
    Configure ImageMagick policies.
  12.  
     
  13.  
    Domains include system, delegate, coder, filter, path, or resource.
  14.  
     
  15.  
    Rights include none, read, write, execute and all. Use | to combine them,
  16.  
    for example: "read | write" to permit read from, or write to, a path.
  17.  
     
  18.  
    Use a glob expression as a pattern.
  19.  
     
  20.  
    Suppose we do not want users to process MPEG video images:
  21.  
     
  22.  
    <policy domain="delegate" rights="none" pattern="mpeg:decode" />
  23.  
     
  24.  
    Here we do not want users reading images from HTTP:
  25.  
     
  26.  
    <policy domain="coder" rights="none" pattern="HTTP" />
  27.  
     
  28.  
    The /repository file system is restricted to read only. We use a glob
  29.  
    expression to match all paths that start with /repository:
  30.  
     
  31.  
    <policy domain="path" rights="read" pattern="/repository/*" />
  32.  
     
  33.  
    Lets prevent users from executing any image filters:
  34.  
     
  35.  
    <policy domain="filter" rights="none" pattern="*" />
  36.  
     
  37.  
    Any large image is cached to disk rather than memory:
  38.  
     
  39.  
    <policy domain="resource" name="area" value="1GP"/>
  40.  
     
  41.  
    Define arguments for the memory, map, area, width, height and disk resources
  42.  
    with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
  43.  
    for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
  44.  
    exceeds policy maximum so memory limit is 1GB).
  45.  
     
  46.  
    Rules are processed in order. Here we want to restrict ImageMagick to only
  47.  
    read or write a small subset of proven web-safe image types:
  48.  
     
  49.  
    <policy domain="delegate" rights="none" pattern="*" />
  50.  
    <policy domain="filter" rights="none" pattern="*" />
  51.  
    <policy domain="coder" rights="none" pattern="*" />
  52.  
    <policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
  53.  
    -->
  54.  
    <policymap>
  55.  
    <!-- <policy domain="system" name="shred" value="2"/> -->
  56.  
    <!-- <policy domain="system" name="precision" value="6"/> -->
  57.  
    <!-- <policy domain="system" name="memory-map" value="anonymous"/> -->
  58.  
    <!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
  59.  
    <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
  60.  
    <policy domain="coder" rights="read | write" pattern="PDF" />
  61.  
    <policy domain="resource" name="memory" value="256MiB"/>
  62.  
    <policy domain="resource" name="map" value="512MiB"/>
  63.  
    <policy domain="resource" name="width" value="16KP"/>
  64.  
    <policy domain="resource" name="height" value="16KP"/>
  65.  
    <!-- <policy domain="resource" name="list-length" value="128"/> -->
  66.  
    <policy domain="resource" name="area" value="128MB"/>
  67.  
    <policy domain="resource" name="disk" value="1GiB"/>
  68.  
    <policy domain="coder" rights="none" pattern="MVG" />
  69.  
    <!-- <policy domain="resource" name="file" value="768"/> -->
  70.  
    <!-- <policy domain="resource" name="thread" value="4"/> -->
  71.  
    <!-- <policy domain="resource" name="throttle" value="0"/> -->
  72.  
    <!-- <policy domain="resource" name="time" value="3600"/> -->
  73.  
    <!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
  74.  
    <!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
  75.  
    <!-- <policy domain="delegate" rights="none" pattern="HTTPS" /> -->
  76.  
    <!-- <policy domain="path" rights="none" pattern="@*" /> -->
  77.  
    <!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
  78.  
    <!-- <policy domain="cache" name="synchronize" value="True"/> -->
  79.  
    <!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
  80.  
    <!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
  81.  
    <!-- <policy domain="system" name="shred" value="2"/> -->
  82.  
    <!-- <policy domain="system" name="precision" value="6"/> -->
  83.  
    <!-- not needed due to the need to use explicitly by mvg: -->
  84.  
    <!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
  85.  
    <!-- use curl -->
  86.  
    <policy domain="delegate" rights="none" pattern="URL" />
  87.  
    <policy domain="delegate" rights="none" pattern="HTTPS" />
  88.  
    <policy domain="delegate" rights="none" pattern="HTTP" />
  89.  
    <!-- in order to avoid to get image with password text -->
  90.  
    <policy domain="path" rights="none" pattern="@*"/>
  91.  
    <!-- disable ghostscript format types -->
  92.  
    <policy domain="coder" rights="none" pattern="PS" />
  93.  
    <policy domain="coder" rights="none" pattern="PS2" />
  94.  
    <policy domain="coder" rights="none" pattern="PS3" />
  95.  
    <policy domain="coder" rights="none" pattern="EPS" />
  96.  
     
  97.  
    <policy domain="coder" rights="none" pattern="XPS" />
  98.  
    <policy domain="coder" rights="read|write" pattern="LABEL" />
  99.  
    </policymap>
学新通

安装软件包

  1.  
    sudo apt install imagemagick
  2.  
     
  3.  
    convert *.png out.pdf

然后可能会报错,直接修改/etc/ImageMagick-6下面的policy.xml文件为最上面的内容,其实可以检查一下,PDF哪些权限然后修改就好了。如果文件名比较有规律,生成的PDF内容也是前后顺序,很不错。

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgfafgb
系列文章
更多 icon
同类精品
更多 icon
继续加载