Read, create, fill, and transform PDF files. Covers extracting text and tables, OCR of scanned pages, filling fillable and flat forms, and flattening…
от appautomaton★ 191 звезда на GitHubОб этом скилле
PDF files
You already know pypdf, pdfplumber and reportlab. This skill adds what they don't give you: form-filling scripts that check their own input, a way to see pages as a reader will, and the PDF behaviours that silently put content in the wrong place.
Running scripts
<skill> is the directory containing this file. Run bundled scripts by absolute path from the user's working directory, so relative paths to their files keep working:
uv run <skill>/scripts/convert_pdf_to_images.py report.pdf pages
Run Python you write with its dependencies declared, either uv run --with pypdf script.py or a PEP 723 header. Rendering pages needs poppler (pdftoppm); OCR also needs Tesseract.
Choosing a tool
| Task | Use |
|---|---|
| Fill a form, fillable or flat | forms.md, always. It has scripts for every step. |
| Text | pdfplumber, or pdftotext -layout from the command line. Text missing from pages that visibly have it means a scan: see ocr.md. |
| Tables | pdfplumber: see tables.md |
| New PDFs | reportlab: Platypus for flowing documents, canvas for exact placement |
| Merge, split, rotate, crop, stamp, encrypt | pypdf: see reference.md for the calls that keep bookmarks, links and orientation intact |
| See what a page looks like | scripts/convert_pdf_to_images.py |
Checking the output
Whenever you create or change a PDF, render the pages you touched and look at them before delivering. Check that the text is present and readable, nothing is clipped or overlapping, and every stamp or value is where it belongs:
uv run <skill>/scripts/convert_pdf_to_images.py out.pdf check --pages 1-3
Pitfalls that fail silently
- Two coordinate systems. PDF coordinates start at the bottom-left of the page box, in points. pdfplumber and page images start at the top-left. The page box need not start at (0, 0), so read
page.cropbox.leftand.bottom. - Rotated pages.
/Rotateturns a page only for display; content and form fields keep unrotated coordinates. Anything placed with a plain scale and y-flip lands in the wrong spot. Convert boxes withscripts/pdf_coords.py, and callpage.transfer_rotation_to_content()before stamping. - Non-Latin text in new PDFs. reportlab's built-in fonts draw Chinese, Cyrillic and similar scripts as black boxes. Register and embed a TrueType font; see reference.md.
- Merging.
PdfWriter.append()keeps bookmarks and links, while copying pages withadd_page()drops them. Merged forms with matching field names become one field, so filling one fills both. - AES encryption needs
uv run --with 'pypdf[crypto]'. Without it, pypdf raisesDependencyErroron open or on encrypt.
Scripts
| Script | Does |
|---|---|
check_fillable_fields.py <pdf> |
Says which form path in forms.md applies |
extract_form_field_info.py <pdf> <out.json> |
Lists fillable fields, their pages, boxes and accepted values |
fill_fillable_fields.py <pdf> <values.json> <out.pdf> |
Fills fields after checking every id, page and value |
convert_pdf_to_images.py <pdf> <dir> [--pages] [--fields] |
Renders pages one at a time to PNG, optionally outlining each fillable field |
check_bounding_boxes.py <fields.json> [pdf] |
Finds overlapping or too-short boxes before a flat form is filled |
create_validation_image.py <page> <fields.json> <png> <out.png> |
Draws those boxes on a page image for checking by eye |
fill_pdf_form_with_annotations.py <pdf> <fields.json> <out.pdf> |
Fills a flat form with text that renders identically everywhere |
flatten_form.py <pdf> <out.pdf> |
Draws filled values into the page so they can't be edited |
pdf_coords.py <pdf> <page> <WxH> --to-pdf/--to-image <box> |
Converts boxes between page-image pixels and PDF points |
Установить pdf в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pdf?
Read, create, fill, and transform PDF files. Covers extracting text and tables, OCR of scanned pages, filling fillable and flat forms, and flattening, merging, splitting, rotating, stamping and encrypting. Use when a task takes a .pdf as input or must produce one.
Как установить скилл pdf?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pdf запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic