📄

PDF Split

Split a large PDF into individual pages or custom page ranges.

Document ⭐ Beginner ⏱️ 2 minutes

😫 The Pain Point

You received a 100-page report but only need pages 15-20 for your presentation. Or you need to extract each page as a separate file for distribution.

🚀 Agentic Solution

A PDF Splitter that extracts exactly the pages you need.

Key Features:

  • Page Ranges: Extract pages 1-5, 10, 15-20 in one command.
  • Individual Pages: Split entire document into one-page PDFs.
  • Batch Mode: Process multiple PDFs at once.

⚔️ Phase 1: Commander (Quick Fix)

For quick extraction.

Prompt:

“I have a PDF report.pdf. Write a Python script using pypdf to:

  1. Page Range: Extract pages 5-15 (1-indexed).
  2. Output: Save as extracted_pages.pdf.
  3. Alternative Mode: Split into individual pages (--split-all flag).

Handle invalid page ranges gracefully. Support password-protected PDFs.”

Result: Exactly the pages you need.

🏗️ Phase 2: Architect (Permanent Tool)

For Document Managers.

Engineering Prompt:

**Role:** Python GUI Developer (PyQt6 Specialist)
**Task:** Create "PDF Splitter Station" Desktop App

**Objective:** A precision tool to explode PDFs or extract specific page ranges securely.

**Tech Stack:**
* Language: Python 3.10+
* GUI Library: PyQt6 (Cross-platform)
* PDF Engine: PyPDF2 / pypdf
* Packaging: PyInstaller

**Functional Requirements:**
1.  **UI Layout (PyQt6):**
    *   **Input:** Source PDF.
    *   **Inspector:** Label showing "Total Pages: 120".
    *   **Modes:** Radio Group for "Burst (All Pages)" vs "Extract Range".
    *   **Range Input:** Text field for "1-5, 8, 11-15".

2.  **Core Logic:**
    *   Parse range string into page indices.
    *   Create new PDF Writer for target pages.
    *   Verify page bounds.
    *   **Threading:** Splitting loop runs in background.

3.  **Deliverables:**
    *   `main.py`: Complete source code.
    *   `requirements.txt`: Dependencies.
    *   **Build Instructions:**
        *   Windows: `pyinstaller --onefile --noconsole main.py`
        *   macOS: `pyinstaller --windowed --noconsole main.py`

🧠 Prompt Decoding

  • 1-indexed: PDF pages are typically numbered starting from 1, not 0.

🛠️ Instructions

  1. Copy Prompt → Run.
  2. Specify page range → Extract.

Related Workflows

Explore other categories

📬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

📖 Free eBook Guide 📦 7 Ready-to-use Scripts 🔔 Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.