pdf-official
What it does
This skill handles PDF files of many kinds, from pulling out text to making new reports and filling forms. It is for people who work with contracts, forms, invoices, and scanned pages.
When to use it
- βWhen you need text or tables pulled out of an existing PDF.
- βWhen you want to combine, split, rotate, or watermark PDF pages.
- βWhen you need to fill a PDF form or make a searchable copy of a scan.
Skill link
https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/pdf-official/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI want to fill in the form fields of this PDF application with my name and address.β
5 new skills a week. 1 minute to read.
How it works
The agent first checks the PDF, such as its page count, encryption, and whether it has form fields. It then routes the task to extracting, transforming, composing, or filling, and checks the result.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
PDF skill
An Apache-2.0 toolkit for reading, composing, transforming, and filling PDF files. Written from scratch on top of permissively-licensed open-source libraries (pypdf, pdfplumber, pypdfium2, reportlab, pdf-lib, qpdf) so this can be embedded in commercial projects without special agreement.
Route the task
Pick the sub-guide by the verb of the request.
| Task | Path | Read |
|---|---|---|
| Pull text / tables / metadata / images out of an existing PDF | Extract | extract.md |
| Combine, carve, rotate, crop, watermark, encrypt, or shrink | Transform | transform.md |
| Build a PDF that doesn't exist yet (report, invoice, certificate) | Compose | compose.md |
| Fill a form (AcroForm or scanned) | Interactive | interactive.md |
| Scanned / image-only PDF (no selectable text) | Extract β OCR | extract.md Β§5 |
If a task mixes several of these, follow the order: probe β plan β extract or compose β validate.
Every path starts with a probe. scripts/survey.py returns page count,
whether the file is encrypted, whether it has an AcroForm, and whether
page 1 looks like a scan.
First install
Bundled runtime: when the
MIMO_PYTHONenvironment variable is set, skip the installs below β run every command withpython3/uv runreplaced by"$MIMO_PYTHON"(pypdf/pypdfium2/reportlab/Pillow preinstalled; pip console scripts unavailable, use"$MIMO_PYTHON" -m <module>). A bundled qpdf is exposed asMIMO_QPDF(picked up automatically by the scripts here); invoke it directly as"$MIMO_QPDF" --check file.pdf.
Python-only path (all BSD / MIT / Apache) β covers 95% of tasks:
python3 -m pip install --upgrade pypdf pdfplumber pypdfium2 reportlab Pillow
Add these external binaries only when you actually need them:
# qpdf β merge/split/encrypt/repair, Apache-2.0
brew install qpdf # macOS
apt-get install -y qpdf # Debian / Ubuntu
# Tesseract β OCR for scanned PDFs, Apache-2.0
brew install tesseract
python3 -m pip install pytesseract pdf2image
apt-get install -y tesseract-ocr
# Poppler β pdftotext / pdftoppm / pdfimages, GPL-2.0
# Optional. Only install if you accept a GPL dependency at CLI level.
brew install poppler
apt-get install -y poppler-utils
Every script under scripts/ uses argparse. Exit codes:
0 OK Β· 1 runtime failure Β· 2 bad arguments Β· 3 validation failure
(apply_values.py / overlay_text.py; sanity_check.py reports findings
with exit 1).
Any single script can be lifted into another project β none imports from a
shared framework.
One-command triage
scripts/survey.py path/to/file.pdf --pretty
Sample output:
{
"path": "/abs/path/file.pdf",
"page_count": 12,
"is_locked": false,
"form_field_count": 34,
"looks_scanned": false,
"metadata": {"Title": "...", "Author": "...", "Producer": "..."}
}
Route by the flags:
is_locked: trueβ unlock first (qpdf --password=β¦ --decrypt). Almost every reader library refuses locked files.form_field_count > 0β widgets path ininteractive.mdΒ§1.form_field_count == 0AND you need to fill it β overlay path ininteractive.mdΒ§2.looks_scanned: trueβ skip pypdf text extraction, go straight to OCR (extract.mdΒ§5).
Which library for which task
| Task | Preferred | Reason | Fallback |
|---|---|---|---|
| Plain text | pdftotext -layout |
fastest, keeps columns | pypdf |
| Positioned text | pdfplumber |
char-level bboxes | pypdfium2.get_text |
| Tables | pdfplumber |
tunable table_settings |
pandas over manual CSV |
| Page β image | pypdfium2 |
Apache/BSD, no GPL | pdftoppm (GPL) |
| Merge / carve / rotate | pypdf |
pure Python | qpdf --pages (faster on huge files) |
| Encrypt / repair / linearise | qpdf |
handles broken input | pypdf (basic encrypt only) |
| Compose from scratch | reportlab |
mature, BSD | pdf-lib in Node |
| Fill AcroForm | pypdf.update_page_form_field_values |
preserves widget appearances | pdf-lib in Node |
| Overlay on non-fillable | reportlab + pypdf.merge_page |
two-layer merge, see interactive.md | β |
Common gotchas
- PDF origin is bottom-left, image origin is top-left. Every "off by a few points" bug is one of these two systems misapplied. Coordinate conversion is in one place: [`
FAQ
Can it read a scanned PDF?
Yes. It can run OCR on a scan so the text becomes searchable.
Can it handle an encrypted PDF?
Yes. The skill covers encrypting and unlocking PDFs.
Does it need special software?
The skill uses Python libraries such as pypdf and needs a setup step before its commands run.
Details
Original description by the author
Use this skill whenever a PDF file is being produced, opened, transformed, filled, or read. That includes: extracting text or tables from an existing PDF; combining, carving, rotating, cropping, or watermarking pages; composing a fresh PDF (report, invoice, certificate); filling AcroForm fields or overlaying text onto a non-fillable scanned form; encrypting or unlocking a PDF; running OCR over a scanned document; rendering pages to PNG/JPEG for visual analysis. Trigger on mentions of 'PDF', a filename ending in .pdf, requests like 'turn this into a PDF report', or references to AcroForm / form
repo: XiaomiMiMo/MiMo-Code
Popularity
- GitHub stars
- 14k
- Ranking position
- #11335
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
effect
14kHelps your agent answer questions about the Effect TypeScript framework by checking its source code and docs instead of relying on memory.
arxiv
14kHelps your agent search, read, cite, and track academic papers on arXiv, including abstracts, BibTeX citations, PDF downloads, and citation links.
claude-code
14kHelps your agent hand a coding task to the Claude Code command line tool, as a one-shot run, an interactive session, or a background job.
codex
14kHelps your agent run the OpenAI Codex command line tool without a chat window, for coding tasks, scripts, and automated pipelines.
Similar skills
feishu-doc
394kHelps your agent read, create, and edit Feishu cloud documents, including text, images, and tables, using the document tool.
feishu-drive
394kLets your agent browse, organize, and comment on files in a Feishu cloud folder that has been shared with the bot.
feishu-perm
394kHelps your agent check and change who can access a Feishu file, choosing the smallest permission that meets your request.