A simple desktop application for splitting and merging PDF files.
This application, built with Python and Tkinter, provides a user-friendly interface for performing two common PDF manipulation tasks:
- Splitting: Split a PDF file into individual pages, either as separate PDF files or as image files (JPG or PNG).
- Merging: Merge multiple PDF files from a folder into a single PDF file. The files are merged in natural sort order (e.g., "page_1.pdf", "page_2.pdf", "page_10.pdf").
- Graphical User Interface (GUI): Easy-to-use interface with clear options and progress feedback.
- PDF Splitting:
- Split a PDF into single-page PDF files.
- Split a PDF into image files (JPG or PNG format).
- Option to select output directory.
- PDF Merging:
- Merge multiple PDF files from a selected folder.
- Files are merged in natural sort order.
- Option to select the output file path.
- Progress and Status Updates: Real-time feedback on the progress of splitting or merging operations.
- Error Handling: Displays informative error messages for common issues such as invalid PDF files, missing files, or write permission problems.
- About Dialog: Displays application information, including version, author, and contact links.
- Python
- Tkinter (GUI)
- PyPDF2 (PDF manipulation)
- pdf2image (PDF to image conversion)
- Pillow (Image processing)
- threading (for non-blocking GUI)
- Poppler (for
pdf2image
)
-
Install Python: Ensure you have Python 3.x installed on your system.
-
Install Dependencies: You can install the required Python packages using pip:
pip install PyPDF2 pdf2image Pillow
- Poppler:
pdf2image
requires Poppler to be installed on your system.- Windows: Download Poppler from a suitable source (e.g., https://github.com/oschwartz10612/poppler-windows/releases/) and extract it. Add the
bin
directory to your system'sPATH
environment variable. - Linux (Debian/Ubuntu):
sudo apt-get install poppler-utils
- macOS:
brew install poppler
(using Homebrew)
- Windows: Download Poppler from a suitable source (e.g., https://github.com/oschwartz10612/poppler-windows/releases/) and extract it. Add the
- Poppler:
-
Download the Code: Clone this repository or download the source code as a ZIP file.
-
Run the Application: Navigate to the directory containing the code and run:
python main.py # or the name of your main script
-
Select Mode: Choose either "Split PDF" or "Merge PDFs" using the radio buttons.
-
Input Selection:
- Split PDF: Click "Browse..." to select the PDF file you want to split.
- Merge PDFs: Click "Browse..." to select the folder containing the PDF files you want to merge.
-
Output Selection: Click "Browse..." to choose the output directory (for splitting) or the output file path (for merging).
-
Start Processing: Click the "Start Splitting" or "Start Merging" button to begin the operation.
-
Enjoy: A message box will appear upon successful completion, and the status label will update.
Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue or submit a pull request.