---
name: "pypdf-document-manipulator"
description: "Merge, split, rotate, watermark, and encrypt PDF files using pure Python pypdf."
metadata:
  author: "py-pdf"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "merge multiple pdf files"
  - "add watermark to pdf python"
  - "encrypt pdf with password pypdf"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# pypdf Document Manipulator

Performs in-memory PDF manipulation using pypdf: concatenating chapters, stamping background watermarks, rotating landscape pages, and encrypting documents with AES-256.

## When to Invoke
Invoke this skill whenever you need to:
- merge multiple pdf files
- add watermark to pdf python
- encrypt pdf with password pypdf

## Execution SOP & Rules
1. Use PdfWriter and PdfReader for programmatic page insertion and transformation.
2. Apply watermarks by overlaying a single-page stamp with page.merge_page(watermark_page).
3. Encrypt documents using writer.encrypt(user_password, owner_password, algorithm="AES-256").
4. Close file streams cleanly or utilize BytesIO for in-memory stream processing.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
