How denreport Uses a Shared IR to Produce Identical Reports in pdfme and ReportLab
Developer wintermaples built denreport, a report-generation tool that targets both pdfme and ReportLab from a single layout design. Instead of converting layouts directly into each library's native format, denreport first translates them into a common intermediate representation (IR) in JSON. The IR standardises all visual decisions — units, coordinates, text positioning, line-breaking, and pagination — before any library-specific export begins. High-level IR elements like tables and page numbers are further expanded into primitive shapes (text, lines, rectangles) so each exporter only needs to handle basic drawing instructions. While pixel-perfect parity is not guaranteed, the approach ensures both export targets produce visually consistent reports from the same source layout.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in