From f7a2e3e66952cd7d6436a7e35deabbc27cf43f91 Mon Sep 17 00:00:00 2001 From: realpython-bot <42617967+realpython-bot@users.noreply.github.com> Date: Wed, 25 Nov 2026 06:08:14 +0000 Subject: [PATCH] Sync creating-and-modifying-pdfs with the maintenance update of Create and Modify PDF Files in Python Co-Authored-By: Claude Opus 5.5 --- creating-and-modifying-pdfs/README.md | 10 ++++++++++ creating-and-modifying-pdfs/requirements.txt | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 creating-and-modifying-pdfs/requirements.txt diff --git a/creating-and-modifying-pdfs/README.md b/creating-and-modifying-pdfs/README.md index d7a4387866..8213c832aa 100644 --- a/creating-and-modifying-pdfs/README.md +++ b/creating-and-modifying-pdfs/README.md @@ -9,4 +9,14 @@ There are two subfolders in this folder: The source code files are organized by section of the tutorial, and the start of each subsection is indicated with comments. +## Requirements + +The code requires Python 3.11 or later. Install the pinned versions of `pypdf` and ReportLab that the tutorial uses with: + +```sh +$ python -m pip install -r requirements.txt +``` + +The tutorial pins `pypdf` to 3.8.1 because the concatenating and merging examples use the `PdfMerger` class, which later `pypdf` releases removed. + The content of the companion tutorial was adapted from the "Creating and Modifying PDF Files" chapter of the book [*Python Basics: A Practical Introduction to Python 3*](https://realpython.com/products/python-basics-book/). If you enjoy this tutorial, check out the full book! diff --git a/creating-and-modifying-pdfs/requirements.txt b/creating-and-modifying-pdfs/requirements.txt new file mode 100644 index 0000000000..be09522e0d --- /dev/null +++ b/creating-and-modifying-pdfs/requirements.txt @@ -0,0 +1,2 @@ +pypdf==3.8.1 +reportlab==5.1.1