Accepted
The initial PDF export path relied on a custom Markdown parser plus ReportLab layout. That approach was fast, but it produced recurring formatting issues:
- ordered lists and nested lists were brittle
- spacing and pagination were difficult to stabilize
- exported reports felt more like raw text conversion than polished documents
The app needed higher-quality, presentation-ready PDF output while still keeping a fallback path available.
Use HTML/CSS rendering with Playwright/Chromium as the primary PDF generation path, with ReportLab retained as a fallback.
The report is first transformed into structured HTML, then rendered to PDF by a browser engine that handles layout more naturally than the earlier custom parser path.
Rejected because the maintenance burden kept rising while output quality remained limited.
Deferred because it adds external binary/toolchain complexity, especially on Windows and in app deployment environments.
Partially helpful for parsing correctness, but it would not fully address the presentation-quality and layout issues that motivated the change.
- PDF output is more faithful to the intended structure and visual hierarchy
- styling is easier to evolve through HTML/CSS than low-level PDF drawing code
- the export path now depends on Playwright/Chromium being available in the environment
- a fallback path still exists if the browser-based export backend fails