gpt4 book ai didi

xslt - 如何更改 wkhtmltopdf 输出中的目录位置?

转载 作者:行者123 更新时间:2023-12-02 02:13:48 27 4
gpt4 key购买 nike

我需要目录在第 3 页。显然,如果有办法控制它,则必须通过 XSL 样式表。但是,我所有的搜索尝试都没有给我任何线索。有可能吗?

我不能使用 cover 选项,因为我需要在第一页和第二页上显示标题。

最佳答案

好的,我找到了使用 wkhtmltopdf 0.11 来完成此操作的方法。我已经将前两页提取到一个单独的 HTML 文档中,然后像这样运行它

wkhtmltopdf [options] page cover.html toc --xsl-style-sheet ... input_file.html out.pdf

不幸的是,它比我预期的要花费更多的精力,因为我通过 wicked_pdf 在 Rails 应用程序中使用它,并且它不能很好地与新的选项格式一起使用,所以我不得不 fork 它并进行必要的也有变化。

wicked_pdf 生成的命令行如下所示(省略长路径):

"c:/program files (x86)/wkhtmltopdf/wkhtmltopdf.exe"  
--header-html "file:///path/to/header" --footer-html "file:///path/to/footer"
--margin-top 20 --margin-bottom 15 --margin-left 5 --margin-right 40 page "file:///path/to/cover/page" --disable-javascript toc --xsl-style-sheet "path/to/style/sheet" - -

关于xslt - 如何更改 wkhtmltopdf 输出中的目录位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11548573/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com