Generate PDFs from HTML templates via REST API using .NET 8 + Playwright. Docker-ready service.
210
REST API to generate PDF files from HTML templates using Handlebars and Playwright (Chromium).
Designed for:
Pull image:
docker pull websvcin/pdf-service:latest
Run container:
docker run -p 8080:80 websvcin/pdf-service
Open Swagger UI:
POST /api/render/pdf
Generates PDF from HTML template.
{ "template": { "type": "base64", "content": "PGgxPkhlbGxvIHt7bmFtZX19PC9oMT4=" }, "data": { "name": "John" }, "options": { "pageSize": "A4", "orientation": "portrait" } }
{ "contentType": "application/pdf", "pdfBase64": "JVBERi0xLjQKJ..." }
Convert base64 to PDF file.
curl -X POST http://localhost:8080/api/render/pdfā -H "Content-Type: application/json" -d '{ "template":{ "type":"base64", "content":"PGgxPkhlbGxvIHt7bmFtZX19PC9oMT4=" }, "data":{ "name":"John" } }'
HTML Template ā Handlebars compile ā Playwright Chromium render ā PDF output (base64)
docker build -t pdf-service .
docker run -p 8080:80 pdf-service
/docs
MIT
Content type
Image
Digest
sha256:ab9845626ā¦
Size
430.1 MB
Last updated
6 months ago
docker pull websvcin/pdf-service