Sign inSign up

rotheross/html2pdf_playwright

By rotheross

Updated over 2 years ago

The html2pdf.js script is a small node.js webserver that uses Playwright to converts HTML to PDF.

Image
0

346

rotheross/html2pdf_playwright repository overview

HTML -> PDF with Playwright

The html2pdf.js script is a small node.js webserver that uses Playwright to converts HTML to PDF.

If you run the script, a sample POST request should look like

POST / HTTP/1.1
User-Agent: Mojolicious (Perl)
Host: localhost:8080
Content-Type: application/json
Content-Length: 73
Accept-Encoding: gzip

{"data":"PGh0bWw+Cjxib2R5Pgo8aDE+VGVzdDwvaDE+CjwvYm9keT4KPC9odG1sPgo=\n"}

And it returns the PDF.

Using docker

To use a docker container to do the conversion, you can use

$ docker pull rotheross/html2pdf_playwright:latest
$ docker run -p 8080:8080 rotheross/html2pdf_playwright:latest

Tag summary

Content type

Image

Digest

sha256:46ac8d39e

Size

685.2 MB

Last updated

over 2 years ago

docker pull rotheross/html2pdf_playwright