Offer an API to convert html to pdf via POST method
It wraps wkhtmltopdf
for the html convert to pdf. The reason we do not use weasyprint
is that weasyprint do not offer a suitable converted result. However, wkhtmltopdf
always return a suitable result. Also, chrome headless mode
do not have the feature that we needed such as footer and header.
docker run -it --rm -p 8000:80 registry.gitlab.com/alphawong/html2pdf
./reload.sh
https://www.getpostman.com/collections/0e61ae04d5f54cb17a5a
curl -X POST \
http://127.0.0.1:8000/convert \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Postman-Token: 455468a3-a8cb-4e88-a9bb-b3e9b61b505d' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F file=@/home/alpha/works/src/github.com/AlphaWong/html2pdf/simple/http2.html \
-F '--footer-left="[page] lalamove"'
- wkhtmltopdf for converting binary
- Noto-unhinted.zip for i18n issue
- Noto-unhinted can resolve the cjk and thai character display issue.