What it does
PDF Merger combines every PDF in a folder into a single file. You can sort the documents alphabetically or by Bates number, and optionally add a table of contents at the front listing each document and the page it starts on — the way a well-assembled exhibit binder or production volume reads.
Setup
-
Install Python 3 (once)
Download it free from python.org/downloads and run the installer. On Windows, check the box that says "Add Python to PATH" during installation.
-
Install the two libraries this tool needs
Open Terminal (Mac) or Command Prompt (Windows) and paste the command for your system:
Mac/usr/local/bin/pip3 install pypdf reportlabWindowspip install pypdf reportlab -
Download the script
Use the download button in the sidebar. Save pdf_merger.py anywhere convenient.
Running the tool
-
Start the script
In Terminal or Command Prompt, navigate to the folder holding the script (type cd, a space, then drag the folder into the window and press Enter). Then run:
Macpython3 pdf_merger.pyWindowspython pdf_merger.py -
Answer the prompts
The script walks you through four questions:
# What it asks, in order:
Folder path ← drag the folder into the window to paste its path
Sort order ← a = alphabetical, b = by Bates number
Output name ← e.g. Production_Vol_1.pdf
Add TOC? ← y = table of contents at the front, n = skip -
Open the merged file
The combined PDF is saved with the name you chose. If you added the table of contents, it appears as the first pages, listing every document and its starting page number.
Common errors
| Error | Fix |
|---|---|
| command not found: python3 | Python isn't installed (or isn't on your PATH). Install it from python.org — on Windows, re-run the installer and check "Add Python to PATH." |
| No module named 'pypdf' | The libraries didn't install. Re-run the install command from Setup step 2. On a Mac, use the full /usr/local/bin/pip3 path shown above. |
| FileNotFoundError | The folder path you entered has a typo. Drag the folder straight into the Terminal window instead of typing the path by hand. |
| No PDFs found in folder | The folder contains no .pdf files at the top level — check that your documents aren't tucked inside subfolders. |
| EOF marker not found / read error | One of the PDFs in the folder is corrupted. The error message names the file — move it out, re-export it from its source, and run again. |