Windows Apps

How to Build a PDF Splitter and Merger Desktop Tool

May 13, 2026
build-pdf-splitter-merger-desktop-tool

Why Engineers Need PDF Tools

Engineering projects generate massive PDF files — drawing sets with 200+ sheets, specification documents spanning hundreds of pages, and calculation reports that grow with every design iteration. You need to extract specific drawings for submittals, merge separate documents into a single package, or split a combined file for distribution to different contractors. Commercial PDF editors charge monthly fees for features you use once a week. A custom tool costs nothing and does exactly what you need.

The Core Library: PyPDF2 or pikepdf

Python's PyPDF2 library handles basic PDF operations: reading, splitting, merging, and extracting pages. For more advanced operations like preserving bookmarks, handling encrypted files, and repairing damaged PDFs, pikepdf is more robust. Both are free and open source.

Building the Splitter

The splitter takes a PDF file path and a page range, then creates a new PDF containing only those pages. Support three modes: single page extraction, range extraction (pages 5-15), and split-all (create a separate file for each page). For engineering drawing sets, the split-all mode is valuable — it produces individual sheet files that can be attached to RFIs or shop drawing reviews.

Building the Merger

The merger takes a list of PDF files and combines them into a single output file. Add drag-and-drop reordering so users can arrange files before merging. Include an option to add blank separator pages between documents — useful when combining calculation packages from different disciplines.

Adding a User Interface

Use Python's tkinter with a file selection dialog for choosing input PDFs. Display a list of selected files with page counts. Add buttons for Split, Merge, and Extract. Show a progress bar for large files. The interface should be simple enough that any engineer can use it without instructions.

Essential UI features:
• Drag-and-drop file selection
• Page range input with validation
• Output folder selection
• Progress indicator for large files
• Success/error notification

Bonus Features Worth Adding

Packaging as a Portable EXE

Use PyInstaller to create a standalone EXE. Include an icon that makes the tool easy to find on the desktop. Test the EXE on a machine without Python installed to confirm all dependencies are bundled correctly.

Sample Code

# Python: split and merge PDFs with PyPDF2
from PyPDF2 import PdfReader, PdfWriter, PdfMerger

def split_pdf(src, start, end, output):
    # Extract pages start..end (0-indexed)
    reader = PdfReader(src)
    writer = PdfWriter()
    for i in range(start, end + 1):
        writer.add_page(reader.pages[i])
    with open(output, 'wb') as f:
        writer.write(f)
    print(f'Saved {output}: pages {start+1}-{end+1}')

def merge_pdfs(file_list, output):
    merger = PdfMerger()
    for pdf in file_list:
        merger.append(pdf)
    merger.write(output)
    merger.close()
    print(f'Merged {len(file_list)} files into {output}')

# Usage
split_pdf('drawings.pdf', 0, 4, 'sheets_1to5.pdf')
merge_pdfs(['cover.pdf', 'calcs.pdf', 'drawings.pdf'], 'package.pdf')

RHCES Tools includes a built-in PDF splitter utility among its 20+ engineering tools. Explore the full suite.

Explore RHCES Store →
#pdf #desktop app #python #document management #engineering #windows