How can I automate HTML-to-PDF conversions?

后端 未结 14 865
攒了一身酷
攒了一身酷 2020-12-23 19:29

I\'ve been using htmldoc for a while, but I\'ve run into some fairly serious limitations. I need the end solution to work on a Linux box. I\'ll be calling this library/utili

14条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 20:19

    WeasyPrint produces nice PDFs with selectable text and hyperlinks.

    weasyprint input.html output.pdf
    

    If you use wkhtmltopdf instead, try the following options:

    wkhtmltopdf --margin-bottom 20mm --margin-top 20mm --minimum-font-size 16 ...
    

提交回复
热议问题