名称:
  wkhtmltopdf 0.12.4 (with patched qt)

大纲:
  wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file>

文档对象简介:
  wkhtmltopdf 能够把多个“对象”合并生成一个pdf文档，这些“对象”可以是“页面对象”、“封面对象”、或是“目录对象”。
  这些对象在pdf文档中的顺序可以通过命令行参数来指定。
  命令行参数包括两部分，一种是针对某一特定“对象”的命令行参数，另一种是全局的命令行参数。
  并且全局的命令行参数只能放在全局参数区([GLOBAL OPTION])中指定。


页面对象简介

  “页面对象”作用是用来把一个网页作为内容输出到PDF文档中。

  (page)? <input url/file name> [PAGE OPTION]...

  “页面对象”的参数可以放在“全局参数域([GLOBAL OPTIONS])”和“页面参数域([PAGE OPTIONS])”。
  程序会根据实际情况在所有参数中找到合适的参数应用到页面、页眉和页脚。


封面对象简介

  “封面对象”用来把一个网页作为封面输出到PDF文档中，输出的页面不会在TOC中出现，并且不会包含页眉和页脚。

  cover <input url/file name> [PAGE OPTION]...

  所有能够在“页面对象”中使用的参数都可以用到“封面对象”


目录对象简介

“目录对象”的作用是输出一个目录到PDF文件中。

  toc [TOC OPTION]...

  所有能够在“页面对象”中使用的参数都可以用到“TOC对象”，并且还有许多的针对“TOC对象”的参数可以应用到“TOC对象”中。
  目录是通过 XSLT 生成的，这就意味着它可以被定义成任何你想看到的样子。
  你可以通过命令行参数 --dump-default-toc-xsl 输出默认的 XSLT 文档，通过 --dump-outline 命令行参数
  可指定以XML格式输出当前处理文档的目录到指定文件。
  更多详细内容请查看后面介绍的 目录对象参数


命令参数

命令参数包含五部分，分别是“全局参数”，“大纲参数选项”，“页面对象参数”，“页眉和页脚参数选项”和“目录对象参数”。


全局参数：

    --collate                 当输出多个副本时进行校验(这是默认设置)
        --no-collate          当输出多个副本时不进行校验
        --cookie-jar <path>   从提供的JAR文件中读写cookie数据
        --copies <number>     设置输出副本的数量(默认主1)，其实为1就够了
    -d, --dpi <dpi>           指定一个要分辨率(这在 X11 系统中并没有什么卵用)
    -H, --extended-help       相对 -h 参数，显示更详细的说明文档
    -g, --grayscale           指定以灰度图生成PDF文档。占用的空间更小
    -h, --help                显示帮助信息
        --htmldoc             输出程序的html帮助文档
        --image-dpi <integer> 当页面中有内嵌的图片时，
                              会下载此命令行参数指定尺寸的图片(默认值是 600)
        --image-quality <interger> 当使用 jpeg 算法压缩图片时使用这个参数指定的质量(默认为 94)
        --license             输出授权信息并退出
    -l, --lowquality          生成低质量的 PDF/PS ,能够很好的节约最终生成文档所占存储空间
        --manpage             输出程序的手册页
    -B, --margin-bottom <unitreal> 设置页面的 底边距
    -L, --margin-left <unitreal>   设置页面的 左边距 (默认是 10mm)
    -R, --margin-right <unitreal>  设置页面的 右边距 (默认是 10mm)
    -T, --margin-top <unitreal>    设置页面的 上边距
    -O, --orientation <orientation> 设置为“风景(Landscape)”或“肖像(Portrait)”模式,
                                    默认是肖像模块(Portrait)
        --page-height <unitreal>   页面高度
    -s, --page-size <Size>         设置页面的尺寸，如：A4,Letter等，默认是：A4
        --page-width <unitreal>    页面宽度
        --no-pdf-compression       不对PDF对象使用丢失少量信息的压缩算法，不建议使用些参数，
                                   因为生成的PDF文件会非常大。
    -q, --quiet                    静态模式，不在标准输出中打印任何信息
        --read-args-from-stdin     从标准输入中读取命令行参数，后续会有针对此指令的详细介绍，
                                   请参见 **从标准输入获取参数**
        --readme                   输出程序的 readme 文档
        --title <text>             生成的PDF文档的标题，如果不指定则使用第一个文档的标题
    -V, --version                  输出版本信息后退出



Outline Options:
      --dump-default-toc-xsl          Dump the default TOC xsl style sheet to
                                      stdout
      --dump-outline <file>           Dump the outline to a file
      --outline                       Put an outline into the pdf (default)
      --no-outline                    Do not put an outline into the pdf
      --outline-depth <level>         Set the depth of the outline (default 4)

Page Options:

     --allow <path>                指定加载HTML中相对路径文件的目录(可重复使用此参数指定多个
                                       目录)，这个参数会在后面进行更详细的讲解
         --background                  输出页面背景到PDF文档(这是默认设置)
         --no-background               不输出页面背景到PDF文档
         --cache-dir <path>            网页的缓存目录
         --checkbox-checked-svg <path> 使用指定的SVG文件渲染选中的复选框
         --checkbox-svg <path>         使用指定的SVG文件渲染未选中的筛选框
         --cookie <name> <value>       设置访问网页时的cookie,value 需要进行url编码
                                       (可重复使用此参数指定多个cookie)
         --custom-header <name> <value> 设置访问网页时的HTTP头(可重复使用此参数指定多个HTTP头)
         --custom-header-propagation   为每个要加载的资源添加由 --custom-header 指定的HTTP头
         --no-custom-header-propagation 不为每个要加载的资源添加由 --custom-header 指定的HTTP头
         --debug-javascript            显示javascript调试输出的信息
         --no-debug-javascript         不显示javascript调试输出的信息(这是默认设置)
         --default-header              添加一个默认的“头”，在页面的左头显示页面的名字，
                                       在页面的右头显示页码，这相对于进行了如下设置：
                                       --header-left='[webpage]'
                                       --header-right='[page]/[toPage]'
                                       --top 2cm
                                       --header-line
         --encoding <encoding>         为输入的文本设置默认的编码方式
         --disable-external-links      禁止页面中的外链生成超链接
         --enable-external-links       允许页面中的外链生成超链接(这是默认设置)
         --disable-forms               不转换HTML表单为PDF表单(这是默认设置)
         --enable-forms                转换HTML表单为PDF表单
         --images                      加载图片并输出到PDF文档(这是默认设置)
         --no-images                   在生成的PDF文档中过滤掉图片
         --disable-internal-links      禁止页面中的内链生成超链接
         --enable-internal-links       允许页面中的内链生成超连接(这是默认设置)
     -n, --disable-javascript          禁止WEB页面执行 javascript
         --enable-javascript           允许WEB页面执行 javascript(这是默认设置)
         --javascript-delay <msec>     延迟一定的毫秒等待javascript 执行完成(默认值是200)
         --load-error-handling <handler> 指定当页面加载失败后的动作，可以指定为：abort(中止)、
                                         ignore(忽略)、skip(跳过)；(默认值是：abort)
         --load-media-error-handling <handler> 指定当媒体文件加载失败后的动作，可以指定为：
                                               abort(中止)、ignore(忽略)、skip(跳过)；
                                               (默认值是：ignore)
         --disable-local-file-access   不允许一个本地文件加载其他的本地文件，使用命令行参数
                                        `--allow` 指定的目录除外。
         --enable-local-file-access    允许本地文件加载其他的本地文件(这是默认设置)
         --minimum-font-size <int>     设置最小的字号，除非必要不推荐使用该参数
         --exclude-from-outline        拒绝加载当前页面到PDF文档的目录和大纲中
         --include-in-outline          加载当前页面到PDF文档的目录和大纲中(这是默认设置)
         --page-offset <offset>        设置页码的起始值(默认值为0)
         --password <password>         HTTP身份认证的密码
         --disable-plugins             禁止使用插件(这是默认设置)
         --enable-plugins              允许使用插件，但插件可能并不工作
         --post <name> <value>         添加一个POST字段，可以重复使用该参数添加多个POST字段。
         --post-file <name> <value>    添加一个POST文件，可以重复使用该参数添加多个文件。
         --print-media-type            用显示媒体类型代替屏幕
         --no-print-media-type         不用显示媒体类型代替屏幕
     -p, --proxy <proxy>               使用代理
     --radiobutton-checked-svg <path>  使用指定的SVG文件渲染选中的单选框
     --radiobutton-svg <path>          使用指定的SVG文件渲染未选中的单选框
     --run-sript <js>                  页面加载完成后执行一个附加的JS文件，可以重复使用此参数指定
                                       多个要在页面加载完成后要执行的JS文件。
     --disable-smart-shrinking         不使用智能收缩策略
     --enable-smart-shrinking          使用智能收缩策略(这是默认设置)
     --stop-slow-scripts               停止运行缓慢的javascript代码(这是默认设置)
     --no-stop-slow-scripts            不停止运行缓慢的javascript代码
     --disable-toc-back-links          禁止从标题链接到目录(这是默认设置)
     --enable-toc-back-links           允许从标题链接到目录
     --user-style-sheet <url>          设置一个在每个页面都加载的用户自定义样式表
     --username <username>             HTTP身谁的用户名
     --viewport-size <>                设置窗口大小,需要你自定义滚动条或css属性来自适应窗口大小。
     --window-status <windowStatus>    Wait until window.status is equal to
                                       this string before rendering page
     --zoom <float>                    设置转换成PDF时页面的缩放比例(默认为1)



Headers And Footer Options:
     --footer-center <text>        在页脚的居中部分显示页脚文本 <text>
     --footer-font-name <name>     设置页脚的字体 (默认为 Arial)
     --footer-font-size <size>     设置页脚的字体大小 (默认为 12)
     --footer-html <url>           添加一个html作为页脚
     --footer-left <text>          在页脚的居左部分显示页脚文本 <text>
     --footer-line                 在页脚上方显示一条直线分隔正文
     --no-footer-line              不使用直线分隔页脚与正文(这是默认设置)
     --footer-right <text>         在页脚的居右部分显示页脚文本 <text>
     --footer-spacing <real>       页脚与正文之间的距离(默认为零)

     --header-center <text>        在页眉的居中部分显示页眉文本 <text>
     --header-font-name <name>     设置页眉的字体 (默认为 Arial)
     --header-font-size <size>     设置页眉的字体大小 (默认为 12)
     --header-html <url>           添加一个html作为页眉
     --header-left <text>          在页眉的居左部分显示页眉文本 <text>
     --header-line                 在页眉下方显示一条直线分隔正文
     --no-header-line              不使用直线分隔页眉与正文(这是默认设置)
     --header-right <text>         在页眉的居右部分显示页眉文本 <text>
     --header-spacing <real>       页眉与正文之间的距离(默认为零)

TOC Options:

    --disable-dotted-lines        在目录中不使用虚线
    --toc-header-text <text>      设置目录的页眉文本
    --toc-level-indentation <width> 第级标题在目录中的缩进宽度(默认为1em)
    --disable-toc-links           在目录中不生成指向内容锚点的超链接
    --toc-text-size-shrink <real> 在目录中每级标题的缩放比例(默认为0.8)
    --xsl-style-sheet <file>      使用自定义的 XSL 样式表显示目录内容


Page sizes:
  The default page size of the rendered document is A4, but using this
  --page-size optionthis can be changed to almost anything else, such as: A3,
  Letter and Legal.  For a full list of supported pages sizes please see
  <http://qt-project.org/doc/qt-4.8/qprinter.html#PaperSize-enum>.

  For a more fine grained control over the page size the --page-height and
  --page-width options may be used

Reading arguments from stdin:
  If you need to convert a lot of pages in a batch, and you feel that
  wkhtmltopdf is a bit too slow to start up, then you should try
  --read-args-from-stdin,

  When --read-args-from-stdin each line of input sent to wkhtmltopdf on stdin
  will act as a separate invocation of wkhtmltopdf, with the arguments specified
  on the given line combined with the arguments given to wkhtmltopdf

  For example one could do the following:

  echo "http://qt-project.org/doc/qt-4.8/qapplication.html qapplication.pdf" >> cmds
  echo "cover google.com http://en.wikipedia.org/wiki/Qt_(software) qt.pdf" >> cmds
  wkhtmltopdf --read-args-from-stdin --book < cmds

Specifying A Proxy:
  By default proxy information will be read from the environment variables:
  proxy, all_proxy and http_proxy, proxy options can also by specified with the
  -p switch

  <type> := "http://" | "socks5://"
  <serif> := <username> (":" <password>)? "@"
  <proxy> := "None" | <type>? <string>? <host> (":" <port>)?

  Here are some examples (In case you are unfamiliar with the BNF):

  http://user:password@myproxyserver:8080
  socks5://myproxyserver
  None

Footers And Headers:
  Headers and footers can be added to the document by the --header-* and
  --footer* arguments respectfully.  In header and footer text string supplied
  to e.g. --header-left, the following variables will be substituted.

  [page]       当前正在被输出页面的页码
  [frompage]   第一页在文档中的页码
  [topage]     最后一面在文档中的页码
  [webpage]    当前正在被输出页面的URL
  [section]    当前正在被输出的章节的名字
  [subsection] 当前正在被输出的小节的名字
  [date]       本地系统格式的当前日期
  [isodate]    ISO 8601 格式的当前日期
  [time]       本地系统格式的当前时间
  [title]      当前对象的标题
  [doctitle]   输出文档的标题
  [sitepage]   当前正在处理的对象中当前页面的页码
  [sitepages]  当前正在处理的对象中的总页数


  As an example specifying --header-right "Page [page] of [toPage]", will result
  in the text "Page x of y" where x is the number of the current page and y is
  the number of the last page, to appear in the upper left corner in the
  document.

  Headers and footers can also be supplied with HTML documents. As an example
  one could specify --header-html header.html, and use the following content in
  header.html:

  <html><head><script>
  function subst() {
      var vars = {};
      var query_strings_from_url = document.location.search.substring(1).split('&');
      for (var query_string in query_strings_from_url) {
          if (query_strings_from_url.hasOwnProperty(query_string)) {
              var temp_var = query_strings_from_url[query_string].split('=', 2);
              vars[temp_var[0]] = decodeURI(temp_var[1]);
          }
      }
      var css_selector_classes = ['page', 'frompage', 'topage', 'webpage', 'section', 'subsection', 'date', 'isodate', 'time', 'title', 'doctitle', 'sitepage', 'sitepages'];
      for (var css_class in css_selector_classes) {
          if (css_selector_classes.hasOwnProperty(css_class)) {
              var element = document.getElementsByClassName(css_selector_classes[css_class]);
              for (var j = 0; j < element.length; ++j) {
                  element[j].textContent = vars[css_selector_classes[css_class]];
              }
          }
      }
  }
  </script></head><body style="border:0; margin: 0;" onload="subst()">
  <table style="border-bottom: 1px solid black; width: 100%">
    <tr>
      <td class="section"></td>
      <td style="text-align:right">
        Page <span class="page"></span> of <span class="topage"></span>
      </td>
    </tr>
  </table>
  </body></html>


  As can be seen from the example, the arguments are sent to the header/footer
  html documents in get fashion.

Outlines:
  Wkhtmltopdf with patched qt has support for PDF outlines also known as book
  marks, this can be enabled by specifying the --outline switch. The outlines
  are generated based on the <h?> tags, for a in-depth description of how this
  is done see the Table Of Content section.

  The outline tree can sometimes be very deep, if the <h?> tags where spread to
  generous in the HTML document.  The --outline-depth switch can be used to
  bound this.

Table Of Content:
  A table of content can be added to the document by adding a toc object to the
  command line. For example:

  wkhtmltopdf toc http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf

  The table of content is generated based on the H tags in the input documents.
  First a XML document is generated, then it is converted to HTML using XSLT.

  The generated XML document can be viewed by dumping it to a file using the
  --dump-outline switch. For example:

  wkhtmltopdf --dump-outline toc.xml http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf

  The XSLT document can be specified using the --xsl-style-sheet switch. For
  example:

  wkhtmltopdf toc --xsl-style-sheet my.xsl http://qt-project.org/doc/qt-4.8/qstring.html qstring.pdf

  The --dump-default-toc-xsl switch can be used to dump the default XSLT style
  sheet to stdout. This is a good start for writing your own style sheet

  wkhtmltopdf --dump-default-toc-xsl
  The XML document is in the namespace "http://wkhtmltopdf.org/outline" it has a
  root node called "outline" which contains a number of "item" nodes. An item
  can contain any number of item. These are the outline subsections to the
  section the item represents. A item node has the following attributes:

 * "title" the name of the section.
 * "page" the page number the section occurs on.
 * "link" a URL that links to the section.
 * "backLink" the name of the anchor the section will link back to.

  The remaining TOC options only affect the default style sheet so they will not
  work when specifying a custom style sheet.

Contact:
  If you experience bugs or want to request new features please visit
  <https://github.com/wkhtmltopdf/wkhtmltopdf/issues>
