How can I automate HTML-to-PDF conversions?

后端 未结 14 915
攒了一身酷
攒了一身酷 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:27

    I have started to put together a tool to provide a simplified interface to common actions.

    You can convert an HTML to a PDF like this:

    $ npm install @lancejpollard/act -g
    $ act convert tmp/index.html -o tmp/index.pdf -w 2000px -h 3000px
    

    This will create a new PDF for the HTML file.

    If nothing else check out the source and see how to write your own script to do this in JavaScript.

提交回复
热议问题