π« The Pain Point
You have a 50-page scanned document. You only need to email pages 5 and 10 to a client. Sending the whole 50MB file is confusing and unprofessional.
π Agentic Solution
The Scissors: Precision extraction of pages.
Key Features:
- Range Support: β1, 3, 5-10β syntax support.
- Burst: Explode a 100-page book into 100 single-page files.
βοΈ Phase 1: Commander (Quick Fix)
For extracting a section.
Prompt:
βExtract pages 1, 3, and 5-10 from
book.pdf. Save them as a new fileextracted.pdf.β
Result: A smaller, focused PDF.
ποΈ Phase 2: Architect (Permanent Tool)
For Archivists.
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create a "PDF Splitter" Tool.
**Requirements:**
1. **GUI:**
* Select Input PDF.
* Option: "Split All Pages" (Burst).
* Option: "Extract Range" (Input: "1,3,5-10").
* "Process" button.
2. **Logic:**
* Parse the range string (handle commas and hyphens).
* Create `PdfWriter`.
* Add selected pages.
* Save.
3. **Deliverables:** `pdf_split.py`, `run.bat` (Windows), `run.sh` (Mac).
π§ Prompt Decoding
- Range Parsing: Teaching the code to understand β5-10β means β5, 6, 7, 8, 9, 10β is a classic logic problem. The AI generates a parser to handle this human-friendly syntax.
π οΈ Instructions
- Copy Prompt -> Paste -> Run.
- Select PDF -> Enter Range -> Cut.