Skip to main content

A tool for splitting PDF files based on bookmarks

Project description

PDF Bookmark Splitter

A Python utility that splits a PDF file into multiple files based on its bookmarks.

Features

  • Splits PDF files using existing bookmarks
  • Creates separate PDF files for each bookmark
  • Maintains original PDF quality
  • Preserves bookmark hierarchy

Requirements

  • Python 3.11+
  • uv - Fast Python package manager
  • PyPDF (automatically installed with package)

Installation

Using uv (Recommended)

This project uses uv for dependency management. First, install uv:

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Then clone and set up the project:

git clone https://github.com/leejss/pdf-bookmark-splitter.git
cd pdf-bookmark-splitter
uv sync

Using pip (Alternative)

You can also install with pip:

pip install git+https://github.com/leejss/pdf-bookmark-splitter.git

Usage

With uv

uv run pdf-split input.pdf --output-dir chapters

With pip installation

pdf-split input.pdf --output-dir chapters

Options

  • --output-dir: Directory to save split PDF files (default: chapters)

Example

# Split PDF and save to 'output' directory
uv run pdf-split book.pdf --output-dir output

This will create separate PDF files in the specified directory, named according to the top-level bookmarks in the input PDF.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf_bookmark_splitter-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_bookmark_splitter-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pdf_bookmark_splitter-0.1.0.tar.gz.

File metadata

File hashes

Hashes for pdf_bookmark_splitter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c88cc9181386d738e977c36a5a171c334b97387393837c836cee0b584c2d9076
MD5 cca0d525080ba25463a812a63bfaa1e3
BLAKE2b-256 3a416bf1aa1920ef6e00397e90754a47e9fb2439d23527e10df29d9a96a1fb9c

See more details on using hashes here.

File details

Details for the file pdf_bookmark_splitter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_bookmark_splitter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b5fba74e610e2a21365633b948ff5254337acfed327e209eb72f009b9fffe6c
MD5 cb1962c86c6fed9443bd2bb617405e1d
BLAKE2b-256 9267721b8fa795bbc2619fd635a8289ae8100c94ec9fc7b2f09e0c0b6021d205

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page