wkhtmltopdf是个开源工具,兼容Linux,Windows等操作系统,可以实现将网页保存为pdf的功能。调用示例:
wkhtmltopdf --grayscale --disable-smart-shrinking --header-html head.html https://www.baidu.com 123.pdf
抛砖引玉,具体参数功能自行检索。
官方网站:https://wkhtmltopdf.org/
未经允许不得转载:阿藏博客 » 网页保存为pdf方案:wkhtmltopdf