Node.js microservice to convert HTML string into base64 PDF file with Puppeteer & Express. Docker ready.
- Node.js
- Express.js
- Puppeteer
Requires Docker
Clone the repo:
git clone https://github.com/VictorLM/node-html-to-pdf-base64
Get into the project folder:
cd node-html-to-pdf-base64
Build the Docker image:
docker build -t html_to_pdf .
Run the Docker container with the built image:
docker run -d -p 127.0.0.1:3000:3000 --name html_to_pdf html_to_pdf
Send a POST request with the "html" field in the request body filled with the HTML string to be converted to PDF:
POST http://localhost:3000
{
"html": "<h1>Hello World!</h1>",
}
Made with ❤️ by Victor Meireles 👋🏽 Get in touch!
Feito com ❤️ por Victor Meireles 👋🏽 Entre em contato!