wkhtmltopdf 目录样式及自定义

1,116 阅读1分钟

1、wkhtmltopdf -H (查看更加详细的命令参数)

image.png

2、导出默认的xsl样式表

wkhtmltopdf --dump-default-toc-xsl >> default.xsl image.png

3、利用修改后的xsl文件,自定义渲染对应的pdf目录(具体的样式表还需自行更改)

wkhtmltopdf toc --toc-header-text "目录" --xsl-style-sheet **/default-toc.xsl ~**/index.html index.pdf

image.png