- 重要参数
—disable-smart-shrinking 页面不缩放 页面就不缩小了
—dpi 这个参数不要用默认值,要设置大一点
letter-spacinng :0 不然字间距太密;
参数 |
说明 |
示例 |
—page-width |
页面宽度 |
—page-width 76mm |
—page-height |
页面高度 |
—page-height 130mm |
—margin-top |
头部边框 |
—margin-top 1mm |
-–margin-left |
左边距 |
|
-–margin-right |
右边距 |
|
-–margin-bottom |
下边距 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Name:
wkhtmltopdf 0.12.6 (with patched qt)
Synopsis:
wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file>
Document objects: 文档对象:
wkhtmltopdf is able to put several objects into the output file, an object is
either a single webpage, a cover webpage or a table of contents. The objects
are put into the output document in the order they are specified on the
command line, options can be specified on a per object basis or in the global
options area. Options from the Global Options section can only be placed in
the global options area.
wkhtmltopdf能够将几个对象放入输出文件中,一个对象是一个单一的网页,一个封面网页或一个目录。的对象
在输出文档中按照命令行,选项可以在每个对象上或全局中指定选择区域。全局选项部分中的选项只能放置在全局选项区域。
A page objects puts the content of a single webpage into the output document.
页面对象将单个网页的内容放入输出文档。
(page)? <input url/file name> [PAGE OPTION]...
Options for the page object can be placed in the global options and the page
options areas. The applicable options can be found in the Page Options and
Headers And Footer Options sections.
(页面)? [PAGE OPTION]…页面对象的选项可以放在全局选项和页面中选择的区域。适用的选项可以在选项和页面中找到页眉和页脚选项部分。
A cover objects puts the content of a single webpage into the output document,
the page does not appear in the table of contents, and does not have headers
and footers.
封面对象将单个网页的内容放入输出文档,页面不会出现在目录中,也没有标题和页脚。
cover <input url/file name> [PAGE OPTION]...
All options that can be specified for a page object can also be specified for
a cover.
封面 [PAGE OPTION]…可以为页面对象指定的所有选项也可以为其指定一个封面。
A table of contents object inserts a table of contents into the output
document.
目录对象将一个目录插入到输出中文档。
toc [TOC OPTION]...
All options that can be specified for a page object can also be specified for
a toc, further more the options from the TOC Options section can also be
applied. The table of contents is generated via XSLT which means that it can
be styled to look however you want it to look. To get an idea of how to do
this you can dump the default xslt document by supplying the
--dump-default-toc-xsl, and the outline it works on by supplying
--dump-outline, see the Outline Options section.
toc (toc选项)……可以为页面对象指定的所有选项也可以为其指定一个toc,进一步的选项从toc选项部分也可以
应用。目录是通过XSLT生成的,这意味着它可以被设计成你想要的样子。想知道怎么做可以通过提供。转储默认的xslt文档
——dump-default-toc-xsl,以及它提供的大纲
——dump-outline,参见Outline选项部分。
Description:
Converts one or more HTML pages into a PDF document, using wkhtmltopdf patched
qt.
转换一个或多个HTML页面到PDF文档,使用wkhtmltopdf补丁
Global Options:
--collate Collate when printing multiple copies (default) 打印多份副本时进行核对
--no-collate Do not collate when printing multiple copies 打印多份时不要核对
--copies <number> Number of copies to print into the pdf
file (default 1) 打印到pdf文件的拷贝数(默认为1)
-H, --extended-help Display more extensive help, detailing
less common command switches 显示更广泛的帮助,详细说明不太常见的命令开关
-g, --grayscale PDF will be generated in grayscale PDF将以灰度生成
-h, --help Display help
--license Output license information and exit 输出license信息并退出
--log-level <level> Set log level to: none, error, warn or
info (default info) 日志级别可设置为:none、error、warn或
信息(默认信息)
-l, --lowquality Generates lower quality pdf/ps. Useful to
shrink the result document space 生成较低质量的pdf/ps。有用的
缩小结果文档空间
-O, --orientation <orientation> Set orientation to Landscape or Portrait
(default Portrait) 设置方向为横向或纵向
(默认纵向)
-s, --page-size <Size> Set paper size to: A4, Letter, etc.
(default A4) 纸张大小设置为:A4,字母等(默认A4)
-q, --quiet Be less verbose, maintained for backwards
compatibility; Same as using --log-level 少啰嗦,向后维护
兼容性;与使用——log-level相同
none
--read-args-from-stdin Read command line arguments from stdin 从stdin读取命令行参数
--title <text> The title of the generated pdf file (The
title of the first document is used if not
specified) 生成的pdf文件的标题
如果没有,则使用第一个文档的标题
指定)
-V, --version Output version information and exit 输出版本信息并退出
Page Options:
--print-media-type Use print media-type instead of screen 使用打印媒体类型代替屏幕
--no-print-media-type Do not use print media-type instead of
screen (default) 不要使用打印媒体类型来代替
屏幕(默认)
Contact:
If you experience bugs or want to request new features please visit 如果您遇到错误或想要求新功能,请访问
<https://wkhtmltopdf.org/support.html>