This repository contains tools for splitting PDF files based on their document outlines (bookmarks). It offers both a web-based UI and a Python command-line interface (CLI).
A user-friendly web interface built with Vue.js, TypeScript, and Vite that allows you to split PDFs directly in your browser.
- Upload a PDF file.
- Preview the document outline.
- Specify a maximum depth for splitting chapters/sections.
- Option to add numerical prefixes to the split file names.
- Download the split PDF files as a ZIP archive.
- All processing is done client-side; your files are not uploaded to a server.
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
If the standalone vue-tsc fails to build due to upstream errors, check out the official documentation for more solutions.
-
Install Dependencies:
pnpm install
(Or
npm install/yarn installif you prefer, though apnpm-lock.yamlis present) -
Run Development Server:
pnpm dev
This will start the Vite development server, typically at
http://localhost:5173. -
Build for Production:
pnpm build
This will compile and minify the application for production deployment into the
distdirectory. -
Preview Production Build:
pnpm preview
This command serves the contents of the
distdirectory locally.
A Python script for splitting PDFs, useful for scripting or server-side operations.
- Splits PDF files based on outline (bookmark) hierarchy.
- Allows specifying a maximum depth for splitting.
For detailed instructions on how to set up and use the Python CLI tool, please refer to its dedicated README file: Python PDF Splitter CLI README
This project was initially based on a standard Vue 3 + TypeScript + Vite template. The web application uses pdfjs-dist for reading PDF structures and pdf-lib for creating and manipulating PDF documents in the browser.