๐ŸŒ
Reportlab
reportlab.com
ReportLab
As well as rapidly generating beautiful PDFs, it can output validated content in a host of different formats for use elsewhere.
๐ŸŒ
Reddit
reddit.com โ€บ r/teachers โ€บ what is www.reportlab.com? anyone encountered it with their students?
r/Teachers on Reddit: What is www.reportlab.com? Anyone encountered it with their students?
January 6, 2026 -

I've been getting a lot of assignments submitted as PDF files that show they were generated in www.reportlab.com. These are generally research papers and I don't understand how it is being used. I would expect them to type it out in Word and then save/export to PDF. Where does this site come in to the mix? I'm worried it means they are just having AI generate the work and outputting it to PDF using that service. From what I can tell it generates PDF files based on data pulled from databases which means it isn't work they've done themselves.

Does anyone have experience with reportlab?

ReportLab PDF Generation Nov 9, 2017
r/learnpython
8y ago
Problems with reportlab library Jun 4, 2023
r/learnpython
3y ago
Can someone point me to a reportlab platypus guide? Oct 11, 2023
r/learnpython
2y ago
Reportlab: insert previously created pdf? Mar 27, 2020
r/learnpython
6y ago
More results from reddit.com
Discussions

Is the Python PDF generator library ReportLab easy to learn?
Reportlab is A MESS! The documentation is very confusing, there aren't really any tutorials or YouTube videos to help you. I would avoid Reportlab. Maybe have a look at xhtml2pdf. It's based on Reportlab, but pretty easy to use. Although it's not really actively maintained. More on reddit.com
๐ŸŒ r/learnpython
7
2
January 16, 2021
PDF image in PDF document using ReportLab (Python) - Stack Overflow
I saved some plots from matplotlib into a pdf format because it seems to offer better quality. How do I include the PDF image into a PDF document using ReportLab? The convenience method Image(filen... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - How can I generate a pdf in Reportlab from information from different documents? - Stack Overflow
I'm trying to extract information ... one pdf. ... I thought that's the way it can get to work but it doesn't. I don't have an option. ... Save this answer. ... Show activity on this post. I don't know if I understand problem but I would do this without nesting loops ยท I assum you have three rows in sample1 X, Y, Z and three rows in sample2 ABC, DEF, GHI ยท It creates three pages X, Y, Z and next three pages ABC, DEF, GHI ยท Copyfrom reportlab.pdfgen import ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to create a pdf report Reportlab
0 I was wondering how could I create a pdf report using reportlab. Iโ€™m developing a web site and Iโ€™m using Django. In my project I charged a lot of icons, and I was using a Javascript function(PrintThisjs), but it doesnโ€™t work well. Seems like Reportlab is a good solution. Thanks ๐Ÿ™‚ More on forum.djangoproject.com
๐ŸŒ forum.djangoproject.com
11
1
July 24, 2020
๐ŸŒ
PyPI
pypi.org โ€บ project โ€บ reportlab
reportlab ยท PyPI
The ReportLab Toolkit. An Open Source Python library for generating PDFs and graphics.
๐ŸŒ
GitHub
github.com โ€บ deepin-community โ€บ python-reportlab
GitHub - deepin-community/python-reportlab ยท GitHub
3. Documentation ================ The latest documentation is available at https://docs.reportlab.com/ For over 20 years we generated our own manuals using the library. In a 'built' distribution, they may already be present in the docs/ directory. If not, execute ``python genAll.py`` in that directory, and it will create three PDF manuals:: reportlab-userguide.pdf reportlab-reference.pdf reportlab-graphics-reference.pdf These are also available in daily build form from the documentation page on our web site.
Author: deepin-community
๐ŸŒ
pdf noodle
pdfnoodle.com โ€บ home โ€บ blog โ€บ how to generate pdf using reportlab in python (updated 2025)
How to Generate PDF Using ReportLab in Python (Updated 2025) - pdf noodle
October 15, 2025 - Instead, you use Python objects (Paragraphs, Tables, Images, Drawings) to build PDFs programmatically. ReportLabโ€™s power lies in constructing PDFs programmatically, not just rendering static HTML.
๐ŸŒ
UnoGeeks
unogeeks.com โ€บ home โ€บ blog โ€บ report lab
Report Lab
January 8, 2024 - This code snippet creates a simple PDF document with a header and a paragraph using ReportLab.
๐ŸŒ
Medium
vonkunesnewton.medium.com โ€บ generating-pdfs-with-reportlab-ced3b04aedef
Generating pdfs with ReportLab
April 6, 2018 - Onto using ReportLab! You can install it with pip install reportlab. Luckily theyโ€™ve created some high level components for us to use in our pdf contained in a module called platypus.
Find elsewhere
๐ŸŒ
Nicd
nicd.org.uk โ€บ knowledge-hub โ€บ creating-pdf-reports-with-reportlab-and-pandas
Data Deep Dive: Creating PDF reports with ReportLab and Pandas
July 31, 2023 - This blog by NICD Data Scientist Fergus McClean presents a detailed look at using ReportLab to generate PDFs from figures created using Pandas.
๐ŸŒ
GitHub
github.com โ€บ nakagami โ€บ reportlab
GitHub - nakagami/reportlab ยท GitHub
July 5, 2026 - It allows rapid creation of rich PDF documents, and also creation of charts in a variety of bitmap and vector formats. This library is also the foundation for our commercial product Report Markup Language (RML), available in the ReportLab PLUS package. RML offers many more features, a template-based style of document development familiar to all web developers, and higher development productivity.
Author: nakagami
๐ŸŒ
Python Assets
pythonassets.com โ€บ posts โ€บ create-pdf-documents-in-python-with-reportlab
Create PDF Documents in Python With ReportLab | Python Assets
February 12, 2022 - ReportLab is an open source toolkit for creating PDF documents from Python. It is a very extensive library with many features, from small texts and geometric figures to large graphics and illustrations, all of which can be included in a PDF.
๐ŸŒ
Reportlab
reportlab.com โ€บ docs โ€บ reportlab-userguide.pdf pdf
ReportLab PDF Library User Guide ReportLab Version 5.0.1
August 23, 2026 - Anyone wanting to automate PDF ... Pipelines of several languages and products can be slow and somewhat unwieldy. The ReportLab library directly creates PDF based on your graphics commands....
๐ŸŒ
Reportlab
docs.reportlab.com
ReportLab Docs
The chart server that keeps going all night! Python chart classes that render as vectors in PDF, or as bitmaps; standard charts and a basis for custom data-driven widgets Overview Custom charts
๐ŸŒ
Reportlab
reportlab.com โ€บ software โ€บ downloads
Download - ReportLab.com
We build solutions to generate rich, attractive and fully bespoke PDF documents at incredible speeds. This can let you serve personalised documents in real time, produce high-quality output, and support all kinds of delivery from web downloads through to personalised digital print.
๐ŸŒ
Reportlab
docs.reportlab.com โ€บ reportlab โ€บ userguide โ€บ ch1_intro
Chapter 1: Introduction - ReportLab Docs
The ReportLab library forms the foundation of our commercial solution for PDF generation, Report Markup Language (RML). This is available for evaluation on our web site with full documentation. We believe that RML is the fastest and easiest way to develop rich PDF workflows.
๐ŸŒ
Reportlab
docs.reportlab.com โ€บ pdf-accessibility
PDF Accessibility - ReportLab Docs
Experience enhanced PDF accessibility with our latest ReportlabPlus 4, now equipped with PDF auto-tagging that is effortlessly in compliance with industry standards, making your documents more accessible and user-friendly for all.
Top answer
1 of 4
5

You can use the wonderful pdfrw package together with reportlab and use it to pass file-like objects of matplotlib figures directly into a flowable:

This was answered before, but I want to give a minimal example here, please also look here: https://stackoverflow.com/a/13870512/4497962

from io import BytesIO
import matplotlib.pyplot as plt
from pdfrw import PdfReader, PdfDict
from pdfrw.buildxobj import pagexobj
from pdfrw.toreportlab import makerl
from reportlab.platypus import Flowable
from reportlab.lib.enums import TA_JUSTIFY,TA_LEFT,TA_CENTER,TA_RIGHT

class PdfImage(Flowable):
    """
    PdfImage wraps the first page from a PDF file as a Flowable
    which can be included into a ReportLab Platypus document.
    Based on the vectorpdf extension in rst2pdf (http://code.google.com/p/rst2pdf/)

    This can be used from the place where you want to return your matplotlib image
    as a Flowable:

        img = BytesIO()

        fig, ax = plt.subplots(figsize=(canvaswidth,canvaswidth))

        ax.plot([1,2,3],[6,5,4],antialiased=True,linewidth=2,color='red',label='a curve')

        fig.savefig(img,format='PDF')

        return(PdfImage(img))

    """

    def __init__(self, filename_or_object, width=None, height=None, kind='direct'):
        # If using StringIO buffer, set pointer to begining
        if hasattr(filename_or_object, 'read'):
            filename_or_object.seek(0)
            #print("read")
        self.page = PdfReader(filename_or_object, decompress=False).pages[0]
        self.xobj = pagexobj(self.page)

        self.imageWidth = width
        self.imageHeight = height
        x1, y1, x2, y2 = self.xobj.BBox

        self._w, self._h = x2 - x1, y2 - y1
        if not self.imageWidth:
            self.imageWidth = self._w
        if not self.imageHeight:
            self.imageHeight = self._h
        self.__ratio = float(self.imageWidth)/self.imageHeight
        if kind in ['direct','absolute'] or width==None or height==None:
            self.drawWidth = width or self.imageWidth
            self.drawHeight = height or self.imageHeight
        elif kind in ['bound','proportional']:
            factor = min(float(width)/self._w,float(height)/self._h)
            self.drawWidth = self._w*factor
            self.drawHeight = self._h*factor

    def wrap(self, availableWidth, availableHeight):
        """
        returns draw- width and height

        convenience function to adapt your image 
        to the available Space that is available
        """
        return self.drawWidth, self.drawHeight

    def drawOn(self, canv, x, y, _sW=0):
        """
        translates Bounding Box and scales the given canvas
        """
        if _sW > 0 and hasattr(self, 'hAlign'):
            a = self.hAlign
            if a in ('CENTER', 'CENTRE', TA_CENTER):
                x += 0.5*_sW
            elif a in ('RIGHT', TA_RIGHT):
                x += _sW
            elif a not in ('LEFT', TA_LEFT):
                raise ValueError("Bad hAlign value " + str(a))

        #xobj_name = makerl(canv._doc, self.xobj)
        xobj_name = makerl(canv, self.xobj)

        xscale = self.drawWidth/self._w
        yscale = self.drawHeight/self._h

        x -= self.xobj.BBox[0] * xscale
        y -= self.xobj.BBox[1] * yscale

        canv.saveState()
        canv.translate(x, y)
        canv.scale(xscale, yscale)
        canv.doForm(xobj_name)
        canv.restoreState()
2 of 4
2

According to ReportLab's FAQ this is only possible with ReportLab PLUS:

Can I use vector graphics in my PDFs?

No, the Open Source package doesn't do this. PageCatcher (see the previous answer) allows you to easily incorporate any vector image by saving it as a PDF and then using it exactly as you would an image file, and Report Markup Language accepts PDF files along with JPG, GIF and PNG.

Update: I haven't looked into this for a while but on the page of pdfrw it says:

pdfrw can read and write PDF files, and can also be used to read in PDFs which can then be used inside reportlab.

Top answer
1 of 1
2

I don't know if I understand problem but I would do this without nesting loops

I assum you have three rows in sample1 X, Y, Z and three rows in sample2 ABC, DEF, GHI

It creates three pages X, Y, Z and next three pages ABC, DEF, GHI

from reportlab.pdfgen import canvas
import csv

c = canvas.Canvas("sample.pdf")

#sample1 = csv.reader(open('sample1.csv'))
#sample2 = csv.reader(open('sample2.csv'))
sample1 = ["X", "Y", "Z"]
sample2 = ["ABC", "DEF", "GHI"]

for a in sample1:
    c.drawString(100, 800, a[0])  # X / Y / Z
    c.showPage()

for b in sample2:
    c.drawString(200, 700, b[0])  # A / D / G
    c.drawString(200, 600, b[1])  # B / E / H
    c.drawString(200, 500, b[2])  # C / F / I
    c.showPage()

c.save()

But if you want to create only three pages X+ABC, Y+DEF, Z+GHI then you need zip()

from reportlab.pdfgen import canvas
import csv

c = canvas.Canvas("sample.pdf")

#sample1 = csv.reader(open('sample1.csv'))
#sample2 = csv.reader(open('sample2.csv'))
sample1 = ["X", "Y", "Z"]
sample2 = ["ABC", "DEF", "GHI"]

for a, b in zip(sample1, sample2):
    c.drawString(100, 800, a[0])

    c.drawString(200, 700, b[0])
    c.drawString(200, 600, b[1])
    c.drawString(200, 500, b[2])

    c.showPage()

c.save()

BTW: If you need nine pages

  • X+ABC, X+DEF, X+GHI
  • Y+ABC, Y+DEF, Y+GHI
  • Z+ABC, Z+DEF, Z+GHI

then you have to move drawString( a[0]) and showPage() inside second loop

from reportlab.pdfgen import canvas
import csv

c = canvas.Canvas("sample.pdf")

#sample1 = csv.reader(open('sample1.csv'))
sample1 = ["X", "Y", "Z"]

for a in sample1:

    #sample2 = csv.reader(open('sample2.csv'))
    sample2 = ["ABC", "DEF", "GHI"]

    for b in sample2:
        c.drawString(100, 800, a[0])

        c.drawString(200, 700, b[0])
        c.drawString(200, 600, b[1])
        c.drawString(200, 500, b[2])

        c.showPage()

c.save()
๐ŸŒ
Django Forum
forum.djangoproject.com โ€บ using django โ€บ forms & apis
How to create a pdf report Reportlab - Forms & APIs - Django Forum
July 24, 2020 - 0 I was wondering how could I create a pdf report using reportlab. Iโ€™m developing a web site and Iโ€™m using Django. In my project I charged a lot of icons, and I was using a Javascript function(PrintThisjs), but it doesnโ€™t work well. Seems like Reportlab is a good solution. Thanks ๐Ÿ™‚