📄

Rotate PDF Pages

Xoay các trang PDF bị ngược, lệch về đúng hướng.

PDF ⭐ Beginner ⏱️ 2 phút

🎯 Vấn đề cần giải quyết

PDF scan có trang bị ngược? Mix trang dọc và ngang? Một số trang cần xoay để đọc?

Pain points:

  • Đọc file cổ xoay đầu
  • Print ra bị lệch hướng
  • Khó share file bị ngược

⚖️ So sánh: Trước và Sau

Tiêu chíThủ côngAgentic Workflow
Thời gian/file5-10 phút30 giây
AccuracyManual checkConsistent
BatchKhông

💡 Prompt mẫu

Xoay trang PDF:

INPUT: [file PDF]

ROTATION:
- All pages: 90° CW / 90° CCW / 180°
- Specific pages: page 3, 5-10 rotate 90° CW
- Auto-detect: xoay trang landscape về portrait

OPTIONS:
- Preserve: bookmarks, links, annotations
- Permanent rotation (modify page)

OUTPUT:
- Suffix: _rotated
- Hoặc overwrite original

🏗️ Phase 2: Architect (Permanent Tool)

For Administrative Staff.

Engineering Prompt:

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

**Objective:** A graphical tool to correct page orientation in mixed-source documents.

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

**Functional Requirements:**
1.  **UI Layout (PyQt6):**
    *   **Input:** Source PDF.
    *   **View:** Thumbnail grid of pages.
    *   **Action:** Click thumbnail to rotate 90°.
    *   **Bulk:** "Rotate All Left/Right" buttons.
    *   **Save:** "Save Changes".

2.  **Core Logic:**
    *   Render thumbnails for preview.
    *   Track rotation state (0, 90, 180, 270).
    *   Apply transforms to PDF Writer.
    *   **Threading:** Thumbnail generation 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`

🔧 Tips & Best Practices

Rotation options

RotationUse case
90° CWPortrait → Landscape
90° CCWLandscape → Portrait
180°Upside down pages
AutoMixed orientation

Common scenarios

  • Scanned docs: Often upside down
  • Mixed orientation: Tables in landscape
  • Legal docs: Landscape charts

Batch processing

  • Apply same rotation to all
  • Specify per-page rotations
  • Auto-detect and correct

Độ khó: ⭐ Beginner | Thời gian: 2 phút

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.