Code Snippets
Code snippets are bits of re-usable code submitted by the ReportLab community. We don't promise that they are accurate, up-to-date or correct - use them at your own risk!
We'd love it if you could participate by submitting your own snippets and sharing your experience with others by commenting. You will need to create a user account by filling out our very simple form.
Python snippets:
-
13 years, 3 monthsCreate a simple Pie chart that can save itself into PDF.
-
13 years, 3 monthsa basic pie chart made with reportlab library
-
13 years, 3 monthsVertical Bar Chart
-
13 years, 3 monthsA breakdown pie chart
-
13 years, 3 monthsA line plot with legend
-
13 years, 3 monthsAn easy way to generate table of contents.
-
13 years, 3 monthsSimple usage of transparent colours.
-
13 years, 3 monthsYou can easily include colourised code samples in your ReportLab scripts
-
13 years, 3 monthsIllustrate alpha for CMYK (actually PCMYK) colors
-
13 years, 2 monthsCreates a TOC like snippet 8, but with clickable text
-
13 years, 1 monthEvaluate formulas at runtime and repeat bottom rows in ReportLab tables.
-
13 yearsSimple example using rml2pdf to generate a PDF document on disk from RML
-
13 yearsSimple Django web application view for dynamically creating a PDF from RML
-
12 years, 6 monthsUse spreadsheet-like tables inside your PDFs
-
12 years, 6 monthsExample of overprinting inks on top of one another to mix colours.
-
10 years, 7 monthsMore intelligent labelling for pie charts
-
10 years, 6 monthsCreate fully customized labels for pie charts by changing colors, borders, ...
-
4 years, 8 months<p>This simple script illustrates drawing an image on a canvas and overdrawing with text.</p>