Agent skill
pdf-tools
Manipulate PDF files using PyMuPDF (fitz). Use when searching/highlighting text in PDFs, merging multiple PDFs, extracting pages, or any PDF manipulation task.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/pdf-tools-devattom-claude
SKILL.md
PDF Tools
Manipulate PDFs using PyMuPDF (fitz).
Setup
pip3 install --user --break-system-packages pymupdf
Search and Highlight Text
import fitz
doc = fitz.open("input.pdf")
for page in doc:
instances = page.search_for("text to find")
for inst in instances:
highlight = page.add_highlight_annot(inst)
highlight.set_colors(stroke=(1, 1, 0)) # Yellow
highlight.update()
doc.save("output.pdf")
Merge PDFs
import fitz
merged = fitz.open()
for pdf_path in ["doc1.pdf", "doc2.pdf"]:
merged.insert_pdf(fitz.open(pdf_path))
merged.save("merged.pdf")
Extract Pages
import fitz
doc = fitz.open("input.pdf")
new_doc = fitz.open()
new_doc.insert_pdf(doc, from_page=5, to_page=10) # Pages 6-11 (0-indexed)
new_doc.save("extract.pdf")
Extract Text
import fitz
doc = fitz.open("input.pdf")
for page in doc:
text = page.get_text()
print(text)
Add Text Annotation
import fitz
doc = fitz.open("input.pdf")
page = doc[0]
rect = fitz.Rect(100, 100, 200, 120)
page.insert_textbox(rect, "Added text", fontsize=12)
doc.save("output.pdf")
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?