Back to Decisions

Report generation: PDF via Puppeteer vs. dedicated reporting lib

Accepted
Katja Vogel2024-03-05
reportingpdfinfrastructure
Context
Why this decision needed to be made

GRI-compliant sustainability reports require precise formatting, tables, charts, and branded cover pages. Need to choose the PDF generation approach.

Options Considered
Comparison of available options
OptionProsConsChosen
Puppeteer (headless Chrome)Selected
  • Full HTML/CSS fidelity
  • Can render chart components directly
  • Team already knows HTML/CSS
  • Handles complex layouts
  • High memory usage (~300 MB per instance)
  • Slower than native PDF libs
  • Serverless cold starts can be slow
PDFKit / React-PDF
  • Lightweight
  • Fast generation
  • No browser dependency
  • Limited layout control
  • Charts require custom SVG rendering
  • Harder to match GRI visual format
—
Outcome
What was decided

Puppeteer headless Chrome for GRI report generation

Rationale
Why this option was chosen

GRI reports require complex multi-column layouts, embedded charts, and precise formatting that is difficult to achieve with code-based PDF libraries. Puppeteer lets us design the report template as a web page and print it — the same fidelity we'd need for a GRI-certified output. Memory footprint is acceptable on a dedicated report worker.