📄

Rotate PDF Pages

Rotate specific pages or all pages in a PDF document.

Document ⭐ Beginner ⏱️ 2 minutes

😫 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:

  1. Rotate: Pages 3, 5, 7-10 by 90° clockwise.
  2. 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

  1. Copy Prompt → Run.
  2. Specify pages and angle.

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.