😫 The Pain Point
A scanned document has some pages oriented incorrectly - landscape pages mixed with portrait. You need to rotate specific pages without affecting others.
🚀 Agentic Solution
A Page Rotator that fixes orientation issues with surgical precision.
Key Features:
- Selective Rotation: Rotate only specific page numbers.
- Multiple Angles: 90°, 180°, 270° options.
- Batch Mode: Fix multiple PDFs at once.
⚔️ Phase 1: Commander (Quick Fix)
For quick fixes.
Prompt:
“I have a PDF
document.pdf. Write a Python script using pypdf to:
- Rotate: Pages 3, 5, 7-10 by 90° clockwise.
- Output: Save as
document_rotated.pdf.Accept page range syntax (e.g., ‘3,5,7-10’). Support angles: 90, 180, 270.”
Result: Properly oriented document.
🏗️ Phase 2: Architect (Permanent Tool)
For Administrative Staff.
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create a "PDF Rotation Tool".
**Requirements:**
1. **GUI:**
* Select PDF.
* Page thumbnails with current orientation.
* Click to toggle rotation (90° per click).
* "Rotate All" with angle dropdown.
* "Save" button.
2. **Logic:**
* Use pypdf page.rotate().
* Preserve other page properties.
* Handle encrypted PDFs.
3. **Deliverables:**
* `pdf_rotate.py`
* `run.bat`, `run.sh`
* `requirements.txt`
🧠 Prompt Decoding
- Clockwise vs Counter-clockwise: Standard convention is positive = clockwise.
🛠️ Instructions
- Copy Prompt → Run.
- Specify pages and angle.