This small prototype shows how to generate a PDF from an HTML template using WeasyPrint inside a Docker container.
How to run (macOS):
- Build image:
docker compose build- Start container:
docker compose up- Open http://localhost:5001/report to download the PDF.
Troubleshooting:
- If WeasyPrint fails with missing libraries, ensure the Dockerfile installs the system packages for cairo/pango/gdk.
- To change content, edit
templates/report.htmland refresh the page.