Here is my experience after following the hints on this page.

  1. pyPDF can't embed images into files. It can only split and merge. (Source: Ctrl+F through its documentation page) Which is great, but not if you have images that are not already embedded in a PDF.

  2. pyPDF2 doesn't seem to have any extra documentation on top of pyPDF.

  3. ReportLab is very extensive. (Userguide) However, with a bit of Ctrl+F and grepping through its source, I got this:

    • First, download the Windows installer and source
    • Then try this on Python command line:

      from reportlab.pdfgen import canvas
      from reportlab.lib.units import inch, cm
      c = canvas.Canvas('ex.pdf')
      c.drawImage('ar.jpg', 0, 0, 10*cm, 10*cm)
      c.showPage()
      c.save()
      

All I needed is to get a bunch of images into a PDF, so that I can check how they look and print them. The above is sufficient to achieve that goal.

ReportLab is great, but would benefit from including helloworlds like the above prominently in its documentation.

Answer from Evgeni Sergeev on Stack Overflow
🌐
GitHub
github.com › py-pdf › fpdf2
GitHub - py-pdf/fpdf2: Simple PDF generation for Python · GitHub
Compared with other PDF libraries, fpdf2 is fast, versatile, easy to learn and to extend (example). It is also entirely written in Python and has very few dependencies: Pillow & fontTools. It is a fork and the successor of PyFPDF (cf.
🌐
Real Python
realpython.com › creating-modifying-pdf
Create and Modify PDF Files in Python – Real Python
March 3, 2026 - You can create new PDF files from scratch with the ReportLab library. Methods to encrypt and decrypt a PDF file with a password are available in pypdf. Concatenating and merging multiple PDF files can be done using pypdf.
Discussions

How to create PDF files in Python - Stack Overflow
I'm working on a project which takes some images from user and then creates a PDF file which contains all of these images. Is there any way or any tool to do this in Python? E.g. to create a PDF f... More on stackoverflow.com
🌐 stackoverflow.com
What would be the best way to create a .pdf file with python?
The problem description is very unclear -- what is in the xlsx file? Is it datapoints that you need to plot? How would the final pdf look like? What did you expect the output of the xlsxwriter script to be? More on reddit.com
🌐 r/learnpython
10
1
April 5, 2021
Markdown to PDF renderer
https://pandoc.org/ Cant't remember the extra thing you need to install for PDF, but it was mentioned in their docs. More on reddit.com
🌐 r/Python
4
5
April 5, 2018
Is it possible to generate LaTeX pdfs directly from python?

Why not get MiKTeX or a similar program that you can run locally? Then you can build the .tex file in python and typeset as part of your program. As a bonus you can clean up the .aux files if you want

More on reddit.com
🌐 r/LaTeX
14
2
December 4, 2018
People also ask

How do I generate a PDF report from HTML in Python?

Use WeasyPrint for print-oriented HTML and CSS, or Playwright with Chromium when the report needs JavaScript. Nutrient API provides hosted HTML-to-PDF conversion with custom fonts, headers, footers, and page numbers.

🌐
nutrient.io
nutrient.io › blog › sdk › top 10 ways to generate pdfs in python
Top 10 Python PDF generator libraries: Complete guide for developers ...
Can I customize the Python PDF output?
Yes. You can choose between light and dark themes, adjust the font size, toggle line numbers on or off, and add a custom title. The output is a high-quality PDF with proper Python syntax highlighting, suitable for printing, sharing, or archiving.
🌐
codeconvert.ai
codeconvert.ai › home › code to pdf › python to pdf
Python to PDF - Export Python Code with Syntax Highlighting | Free ...
Is the Python to PDF tool free to use?
Yes. You can convert your Python code to PDF for free without creating an account. Just paste your code, customize the options, and download your PDF.
🌐
codeconvert.ai
codeconvert.ai › home › code to pdf › python to pdf
Python to PDF - Export Python Code with Syntax Highlighting | Free ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › creating-pdf-documents-with-python
Creating PDF Documents with Python - GeeksforGeeks
January 19, 2026 - PDF (Portable Document Format) is widely used for documents that require a fixed layout and consistent appearance. Using Python, we can create PDF files programmatically with the help of the ReportLab library.
🌐
Nutrient
nutrient.io › blog › sdk › top 10 ways to generate pdfs in python
Top 10 Python PDF generator libraries: Complete guide for developers (2026)
October 15, 2026 - It enables you to create bar charts, line charts, and pie charts with extensive customization. ReportLab works well for detailed reports with charts, graphs, and complex page layouts. For simpler PDFs, consider FPDF or img2pdf. PDFKit(opens in a new tab) wraps wkhtmltopdf(opens in a new tab) to convert HTML to PDF. The Python wrapper is deprecated, and wkhtmltopdf’s repository was archived in January 2023.
🌐
APITemplate.io
apitemplate.io › home › blog › generate pdfs in python with 7 popular libraries in 2025
Generate PDFs in Python with 7 Popular Libraries in 2025
September 10, 2026 - ... ReportLab is a python library that helps you to create PDF.it has its opensource version and a commercial version, and the difference is that the commercial version supports a Report Markup Language (RML)both provide you with the following ...
Find elsewhere
🌐
CodeConvert AI
codeconvert.ai › home › code to pdf › python to pdf
Python to PDF - Export Python Code with Syntax Highlighting | Free Online
Syntax highlighting for more than 50 programming languages ... Paste your Python code into the editor, customize your PDF options (theme, font size, line numbers), and click Generate PDF.
🌐
IronPDF
ironpdf.com › how-tos › create pdf
Create PDF in Python: HTML, File & URL Methods | IronPDF
August 2, 2026 - Create PDF files in Python using IronPDF by converting HTML strings, HTML files, or URLs to PDF documents with just a few lines of code. IronPDF handles rendering, formatting, and security features automatically.
🌐
IronPDF
ironpdf.com › ironpdf for python › blog › python pdf tools › python create pdf
Python Create PDF (Developer Tutorial) | IronPDF for Python
April 24, 2026 - Search and open Python default IDLE shell from the Windows search bar and press Ctrl + N or select "New File" from the File tab. This will open the text editor for writing the code.
🌐
Perfect Doc Studio
perfectdoc.studio › home › how to generate pdf documents using python?
How to Generate PDF Documents With Python? Methods & guides.
December 5, 2025 - Python has powerful capabilities for creating documents across various business applications. The combination of ReportLab and PyPDF2 offers comprehensive solutions for professional document generation. The investment in learning PDF generation pays off, it’s obvious because of the efficiency, consistency, and professional presentation of your organization’s documents.
🌐
Honeybadger
honeybadger.io › blog › python-pdf
Working with PDFs in Python - Honeybadger Developer Blog
September 1, 2022 - You'll use FPDF to create new PDF files. Note: If you're using Python 2, you can use PyPDF (the old version of PyPDF2) instead. I'll use PyPDF2 with Python 3 in this article, although you can use either PyPDF2 or PyPDF4.
🌐
Mouse Vs Python
blog.pythonlibrary.org › home › python 101 – how to generate a pdf
Python 101 - How to Generate a PDF - Mouse Vs Python
September 28, 2021 - To make the document generate properly, ... in it: a Paragraph(). Instead of calling save() to create the PDF, you call build() and pass in the list of Flowables....
🌐
Templated
templated.io › blog › generate-pdfs-in-python-with-libraries
How to Generate PDFs in Python: 8 Tools Compared (Updated for 2025)
September 16, 2024 - Explore eight powerful Python libraries for PDF generation: FPDF2, ReportLab, Playwright, Pyppeteer, Python-Wkhtmltopdf, PDFKit, WeasyPrint, and Borb. Compare their performance, features, and use cases to choose the best tool for your PDF creation ...
🌐
GitConnected
levelup.gitconnected.com › how-to-create-a-pdf-document-using-python-15b19cd65a3e
How to Create a PDF Document Using Python? | by Umair Akram | Level Up Coding
January 12, 2024 - Python is a vibrant language and there are a lot of libraries to do a certain task. PDF generation is no exception. There are the following libraries to address the problem at hand: I. Aspose.Words · II. FPDF (Free PDF)
🌐
Reintech
reintech.io › blog › how-to-create-pdfs-with-python
How to Create PDFs with Python
January 22, 2026 - Python's ecosystem offers several powerful libraries for PDF generation, with ReportLab standing out as the industry standard for programmatic PDF creation.
🌐
Anvil
anvil.works › blog › generate-pdf-with-python
Generating PDF Reports from a Python Script - Anvil Works
We’re going to do just that, using Anvil. Anvil is a platform for building web UIs, but today we’ll just be using it to make PDFs. In this example, we’re going to take two CSVs, representing sales data from this month and last month, and create a PDF report that looks like this:
🌐
Medium
medium.com › codex › create-a-custom-pdf-using-python-219a7e11c78b
Create a Custom PDF using Python. In this article, I will show you how we… | by Liang Han Sheng | CodeX | Medium
July 31, 2026 - In this article, I will show you how we can create a PDF using Python with FPDF library. By default, FPDF only support certain languages…
🌐
Roy Tutorials
roytuts.com › home › python › how to create a pdf file using python
How to create a PDF File using Python - Roy Tutorials
October 27, 2023 - Python 3.8.0 – 3.9.1, fpdf 1.7.2 (pip install fpdf or pip install fpdf=1.7) Install the required pdf library FPDF using the below command from command line tool in administrator mode. ... Now I will create a Python script that will create or generate pdf file.
🌐
GeeksforGeeks
geeksforgeeks.org › creating-pdf-documents-with-python
Creating PDF Documents With Python - GeeksforGeeks
March 21, 2024 - Creating ebooks can be a rewarding ... documentation. The borb library in Python is a powerful tool that enables developers to generate PDFs with rich formatting and various multimedia elements....
🌐
Aspose
blog.aspose.com › aspose.blogs › how to create pdf in python: a comprehensive guide
How to Create PDF in Python | Create Online PDF Editor and Viewer
March 14, 2023 - To generate PDF files in Python, we will use Aspose.PDF for Python. It is an amazing PDF manipulation library that you can use to create, edit and process PDF files with ease.