Skip to main content

📑 pdf-appendix

PyPI version

pdf-appendix is a lightweight command-line tool for merging appendix PDFs into a main document.

It is designed for reports where the main document contains title pages for each appendix, and the appendices need to be inserted at the right spots.


✨ Features

  • 📂 Merge multiple appendices into a main PDF
  • 🔀 Interleave appendices with main document title pages, or append as a block
  • 📑 Preserve the last N pages of the main document at the end (--end-pages)
  • 📁 Use appendices from a custom folder (--appendix-folder)
  • 📂 Save the merged PDF in a custom folder (--output-folder)
  • 📝 Set a custom output filename (--filename)
  • 🔍 Regex-based appendix file matching (--pattern)
  • 📊 Verbose logging for debugging (--verbose)

⚙️ Installation

Install from PyPI with pip:

pip install pdf-appendix

📖 Usage

Run from the command line:

pdf-appendix main.pdf

🔍 Options

  • --pattern: Regex for appendix filenames (default: "_\d+")

  • --no-interleave: Append all appendices as one block instead of interleaving

  • --end-pages N: Preserve the last N pages of the main document at the very end

  • --appendix-folder PATH: Folder where appendix PDFs are stored (default: same as main file)

  • --output-folder PATH: Folder where the merged PDF will be saved (default: same as main file)

  • --filename NAME: Custom output filename (default: <main>_with_appendix.pdf)

  • --verbose: Show detailed debug output

Examples

# Append appendix files like report_1.pdf, report_2.pdf ...
pdf-appendix report.pdf

# Match files appendix_1.pdf, appendix_2.pdf ...
pdf-appendix report.pdf --pattern "appendix_\d+"

# Append all appendices at the end (no interleaving)
pdf-appendix report.pdf --no-interleave

# Preserve last 2 pages of main document
pdf-appendix report.pdf --end-pages 2

# Use appendices from a different folder
pdf-appendix report.pdf --appendix-folder ./appendices

# Save output in a different folder
pdf-appendix report.pdf --output-folder ./output

# Save output with a custom filename
pdf-appendix report.pdf --filename merged.pdf

# Verbose output (DEBUG level)
pdf-appendix report.pdf --verbose

📑 About Interleaving

The --interleave option is intended for cases where your main document already includes placeholder title pages for each appendix (e.g. a page that says “Appendix 1”, “Appendix 2”, …).

When --interleave is enabled (default):

The tool inserts each appendix directly after its corresponding title page in the main document.

When --no-interleave:

All appendices are simply appended at the end of the main document in order.

This allows you to prepare a clean report with dedicated appendix cover pages and let the tool place the actual appendix content in the right spots automatically.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Third-Party Licenses

This project makes use of the following third-party library:

  • pypdf — licensed under the BSD-3-Clause License

Build tools and development dependencies (such as black and pytest) are licensed under permissive licenses (MIT or similar) and are only used during development and packaging.

See THIRD_PARTY_LICENSES for details.

Release files for pdf-appendix 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdf-appendix 1.0.0
File Size Uploaded
pdf_appendix-1.0.0.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pdf-appendix 1.0.0
File Interpreter ABI Platform
pdf_appendix-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.1 kB

Release files / pdf_appendix-1.0.0.tar.gz

Download URL pdf_appendix-1.0.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3fe1186adf2b8c27e9248843285bbb3ef9f30e94df7713f7d52d47078923a950
BLAKE2b-256 checksum
How to use checksums
d538f80cb0daa392436a4cc1af7e2a6c1f9050984b52952de74bc922cf165954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / pdf_appendix-1.0.0-py3-none-any.whl

Download URL pdf_appendix-1.0.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa5b7d46ee8389a0190dc534501d1faa3b066d4e12ffe17f47c429e4fab5e42a
BLAKE2b-256 checksum
How to use checksums
d89b53a7016a07697c26662d95b7f68a8dc0a2035226aefc44febae24c13204a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page