Skip to content
Agentmart
Submit a tool

pdf

Use when reading, creating, merging, splitting or filling PDFs — extracting text or tables, combining files, rotating or watermarking pages, filling a…

Skill by iaa2005

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/iaa2005-pdf

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when reading, creating, merging, splitting or filling PDFs — extracting text or tables, combining files, rotating or watermarking pages, filling a fillable form, or producing a PDF report.

Use cases: documents

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/pdf

What's inside

Skill name
pdf
Description
Use when reading, creating, merging, splitting or filling PDFs — extracting text or tables, combining files, rotating or watermarking pages, filling a fillable form, or producing a PDF report.
License
MIT
Instructions
127 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (4)

  • SKILL.md
  • reference.md
  • fill_form.py · scripts/
  • inspect_pdf.py · scripts/

SKILL.md (first lines)

Run the scripts in `scripts/` rather than rewriting them inline. `reference.md`
covers overlaying text on a flat PDF, locating anchors, tables without ruling
lines, watermarks, rendering pages to images, metadata and encryption.

## Always inspect first

A PDF hides the two things that decide your whole approach: whether there is a
text layer at all, and whether it has form fields.

```
python scripts/inspect_pdf.py file.pdf
```

Reports pages, encryption, metadata, extractable text with a sample, form field
names and types, and page geometry. It distinguishes a **scan** (image with no
text) from a merely sparse page, because that difference decides everything.

> If the text layer is empty, the pages are images. There is nothing to
> extract. Say so and offer OCR — never report a scanned document as blank.

## Filling a form

```
python scripts/fill_form.py form.pdf --list                 # field names first
python scripts/fill_form.py form.pdf out.pdf --set name="Ivan" --set city="Moscow"
python scripts/fill_form.py form.pdf out.pdf --json values.json
```

Why a script and not three lines: a filled form that opens **blank** is the
classic outcome. Field values and the drawn appearance are separate things in
the format, so the file needs `NeedAppearances` set or several viewers (Chrome
included) render nothing. The script sets it, writes both to the pages and the
AcroForm root, reads the file back to verify the values stuck, and refuses
unknown field names instead of silently doing nothing.

It also warns when a value contains non-Latin-1 characters: form fonts are
usually Helvetica, so Cyrillic is stored correctly but **drawn as garbage**.
Software sees the right value, a human sees boxes.

## Extracting text and tables

```python
import pypdf
r = pypdf.PdfReader('in.pdf')
text = '\n'.join(p.extract_text() or '' for p in r.pages)
```

`extract_text()` flattens tables into ragged lines. For real tables use
`pdfplumber` where it is available:

```python
import pdfplumber
with pdfplumber.open('in.pdf') as pdf:
    for t in pdf.pages[0].extract_tables():
        for row in t:
            print(row)
```

Always show the user a sample of what you parsed before computing on it —
silently misaligned columns is the classic failure here.

## Merging, splitting, rotating

```python
w = pypdf.PdfWriter()
for f in ['a.pdf', 'b.pdf']:
    w.append(f)
w.write('merged.pdf')

r = pypdf.PdfReader('in.pdf')
w = pypdf.PdfWriter()
for p in r.pages[2:5]:
    w.add_page(p)
w.write('pages3-5.pdf')

page.rotate(90)          # multiples of 90 only
```

## Creating a PDF

Engine decides the tool — read the first line of the RunPython description:

- **PYODIDE** — `fpdf2`. Its core fonts are Latin-1: for Cyrillic you MUST
  embed a Unicode TTF or the text becomes garbage.

```python
from fpdf import FPDF
pdf = FPDF()
pdf.add_font('DejaVu', '', 'DejaVuSans.ttf')
pdf.set_font('DejaVu', size=12)
pdf.add_page()
pdf.multi_cell(0, 8, 'Отчёт за квартал')
pdf.output('report.pdf')
```

- **LOCAL SUBPROCESS** — check for LaTeX first (`shutil.which('pdflatex')`,
  `'xelatex'`, `'tectonic'`). If present, write `.tex` and run it TWICE — the
  second pass resolves references and the table of contents. If absent, fall
  back to fpdf2 and say LaTeX was not found.
- **PODMAN** — `subprocess.run(['tectonic', 'report.tex'])`; it fetches missing
  TeX packages itself.

When the user wants something editable, deliver the `.tex` as well — the app
previews it with highlighting.

## Encryption

```python
w.encrypt(user_password='...')
```

Never invent a password, never add protection that was not asked for, and never
write a password into the chat.

## Verify before claiming success

```python
import pypdf
r = pypdf.PdfReader('out.pdf')

From iaa2005/monet-directory, MIT.

More from iaa2005/monet-directory

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 10, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from iaa2005

Cite this page

pdf skill. Agent Mart. https://agentmart.dev/skills/iaa2005-pdf (last updated 2026-10-24)