😫 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:
- Page Range: Extract pages 5-15 (1-indexed).
- Output: Save as
extracted_pages.pdf.- Alternative Mode: Split into individual pages (
--split-allflag).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 Tool Developer
**Task:** Create a "PDF Splitter App".
**Requirements:**
1. **GUI:**
* Select input PDF.
* Show total page count.
* Page range input (e.g., "1-5, 10, 15-20").
* Radio: Extract range vs Split all.
* "Split" button + Progress bar.
2. **Logic:**
* Parse page range syntax.
* Validate against actual page count.
* Name output files logically.
3. **Deliverables:**
* `pdf_split.py`
* `run.bat`, `run.sh`
* `requirements.txt`
🧠 Prompt Decoding
- 1-indexed: PDF pages are typically numbered starting from 1, not 0.
🛠️ Instructions
- Copy Prompt → Run.
- Specify page range → Extract.