ReportLab Toolkit Python PDF-generation toolkit with a drawing canvas and flow-based Platypus page layout.
Overview ReportLab Toolkit is an open-source Python library for generating PDFs and graphics. It provides a low-level drawing canvas and the higher-level Platypus layout system for assembling flowing content into pages. This article covers the open-source toolkit, whose features and license are distinct from ReportLab's commercial PLUS and RML offerings.[1] [2] [3]
Contents Drawing individual pages The pdfgen canvas exposes coordinate-based drawing operations. Programs place text and graphics on a page, advance to subsequent pages and finally save the document. Page dimensions are explicit and affect coordinates and margins. This approach suits precisely positioned output, but it also makes the application responsible for its positioning logic rather than treating the PDF as an editable word-processing document.[2]
Flowing content through templates Platypus provides a higher-level document model. A sequence of flowables, such as paragraphs and spacers, is processed through frames and page templates. Page callbacks can draw recurring material independently of the flowing story. Developers can therefore separate content from recurring layout, while still dropping down to canvas drawing when needed. This is a Python object model, not an assertion of compatibility with arbitrary HTML/CSS templates.[3]
Open-source and commercial scope The vendor describes the open-source library as BSD-licensed and distinguishes its Python-driven document construction from the commercial RML templating product. Its FAQ also assigns reading and reusing existing PDF content to PageCatcher in ReportLab PLUS. A project that generates new reports and a project that imports existing designed pages therefore have different requirements. Commercial package capabilities should not be assumed to accompany the base reportlab installation.[1]
Current deployment changes The installation guide says the base moved to pure Python in version 4.0, with optional components for acceleration and graphics. The newer 5.0 release notes supersede older instructions for legacy renderPM C extensions: those backends are no longer offered, while rlPyCairo remains supported. Version 5.0 also changes the meaning of an unset trusted-image-source configuration to trust no source. Applications that fetch remote images must account for that deliberate behavior change.[4] [5]
Substitution considerations ReportLab Toolkit can substitute for fpdf2 in producing PDFs from Python-controlled content. The appropriate comparison is the document model: explicit drawing, flowing stories, fonts and output requirements. Existing fpdf2 code is not directly portable to canvas or Platypus APIs, and any reliance on importing PDFs requires separately established tooling. No rendering or performance comparison was executed for this article.[1] [2] [3] [6]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.