pymupdf
PyMuPDF (fitz) - PDF manipulation library. Use for PDF text extraction, table detection, image extraction, and document parsing.
When & Why to Use This Skill
This Claude skill provides comprehensive PDF manipulation and parsing capabilities powered by the PyMuPDF (fitz) library. It enables high-performance text extraction, table detection, image rendering, and advanced document editing features such as merging, cropping, and metadata management, making it an essential tool for automating complex document workflows.
Use Cases
- Automated Data Extraction: Extracting structured text, tables, and specific data points from PDF reports, invoices, or academic papers for analysis.
- Document Transformation: Converting PDF pages into high-quality images (PNG/JPEG) or merging multiple files into a single document for streamlined distribution.
- Content Parsing & Archiving: Identifying and extracting embedded images and metadata from technical documents to build searchable digital archives.
- Layout Manipulation: Programmatically adjusting page boundaries, cropping content, and managing colorspaces for professional document preparation and formatting.
| name | pymupdf |
|---|---|
| description | PyMuPDF (fitz) - PDF manipulation library. Use for PDF text extraction, table detection, image extraction, and document parsing. |
Pymupdf Skill
Comprehensive assistance with pymupdf development, generated from official documentation.
When to Use This Skill
This skill should be triggered when:
- Working with pymupdf
- Asking about pymupdf features or APIs
- Implementing pymupdf solutions
- Debugging pymupdf code
- Learning pymupdf best practices
Quick Reference
Common Patterns
Pattern 1: The name identifying the colorspace. Example: pymupdf.csCMYK.name = ‘DeviceCMYK’.
csRGB
Pattern 2: Added a method paper_rect() which returns a Rect for a supplied paper format string. Example: fitz.paper_rect(“letter”) = fitz.Rect(0.0, 0.0, 612.0, 792.0).
paper_rect()
Pattern 3: Example:
bottom-left -> top-left
Pattern 4: A typical use of this attribute would be setting Page.cropbox_position to this value, when you are creating shapes for later or external use. If you have not manipulated the attribute yourself, it should reflect a rectangle that contains all drawings so far.
Page.cropbox_position
Pattern 5: With Document.insert_file() you can invoke the method to merge supported files with PDF. For example:
Document.insert_file()
Pattern 6: Example:
Page.cropbox_position()
Pattern 7: pix is a Pixmap object which (in this case) contains an RGB image of the page, ready to be used for many purposes. Method Page.get_pixmap() offers lots of variations for controlling the image: resolution / DPI, colorspace (e.g. to produce a grayscale image or an image with a subtractive color scheme), transparency, rotation, mirroring, shifting, shearing, etc. For example: to create an RGBA image (i.e. containing an alpha channel), specify pix = page.get_pixmap(alpha=True).
pix
Pattern 8: Please see the Stories recipes for a number of typical use cases.
Document.convert_to_pdf()
Reference Files
This skill includes comprehensive documentation in references/:
- _images.md - Images documentation
- api.md - Api documentation
- index.html.md - Index.Html documentation
- other.md - Other documentation
- tutorials.md - Tutorials documentation
Use view to read specific reference files when detailed information is needed.
Working with This Skill
For Beginners
Start with the getting_started or tutorials reference files for foundational concepts.
For Specific Features
Use the appropriate category reference file (api, guides, etc.) for detailed information.
For Code Examples
The quick reference section above contains common patterns extracted from the official docs.
Resources
references/
Organized documentation extracted from official sources. These files contain:
- Detailed explanations
- Code examples with language annotations
- Links to original documentation
- Table of contents for quick navigation
scripts/
Add helper scripts here for common automation tasks.
assets/
Add templates, boilerplate, or example projects here.
Notes
- This skill was automatically generated from official documentation
- Reference files preserve the structure and examples from source docs
- Code examples include language detection for better syntax highlighting
- Quick reference patterns are extracted from common usage examples in the docs
Updating
To refresh this skill with updated documentation:
- Re-run the scraper with the same configuration
- The skill will be rebuilt with the latest information