---
name: "pymupdf-highspeed-rasterizer"
description: "Rasterize PDF pages into high-res images and extract vector graphics at microsecond speeds."
metadata:
  author: "Artifex"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "rasterize pdf page to image pymupdf"
  - "search keyword in pdf pymupdf"
  - "highlight text in pdf"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# PyMuPDF High-Speed Document Rasterizer

Utilizes PyMuPDF (fitz) C-library bindings to render PDF pages to Pixmaps, extract embedded vector paths, search keywords with bounding rects, and highlight text programmatically.

## When to Invoke
Invoke this skill whenever you need to:
- rasterize pdf page to image pymupdf
- search keyword in pdf pymupdf
- highlight text in pdf

## Execution SOP & Rules
1. Open documents with doc = fitz.open(path) and iterate pages via for page in doc.
2. Generate high-resolution images using page.get_pixmap(dpi=300).save("page.png").
3. Search keywords with page.search_for("clause") and apply highlights with page.add_highlight_annot(rect).
4. Save modified documents with doc.save(output_path, garbage=4, deflate=True).

## 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.
