如何使用 pandoc 将 HTML 转换为 PDF?

2024-06-26

我需要哪些库? 我需要传递哪些命令行参数?

我已经安装了 wkhtml2pdf 和 我尝试过运行:

pandoc reports/7/report.html -t pdf -o reports/7/report.pdf

报告错误如下:

To create a pdf with pandoc, use the latex or beamer writer and specify
an output file with .pdf extension (pandoc -t latex -o filename.pdf).

pdf不是有效的输出格式。latex and beamer(对于乳胶幻灯片)是。

要创建 pdf,请使用-t latex and -o myoutput.pdf。您可以省略-t争论自.pdf in -o默认为乳胶。所以你可以使用:

pandoc reports/7/report.html -t latex -o reports/7/report.pdf

or:

pandoc reports/7/report.html -o reports/7/report.pdf
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 pandoc 将 HTML 转换为 PDF? 的相关文章

随机推荐