Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Pdf Specialist Skill

ASecurity

Create, read, edit, analyze PDFs — forms, OCR, merge, split, convert, watermark, encryption, image extraction. Any PDF/.pdf mention. Not Word or spreadsheets.

6 stars
0 votes
0 copies
0 views
Added 9/20/2026
documentationpythongobash

Works with

cli

Security Analysis

A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add darellchua2/opencode-config-template --skill pdf-specialist-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pdf Specialist Skill?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Pdf Specialist Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/darellchua2-pdf-specialist-skill/badge)](https://www.skillsdirectory.com/skills/darellchua2-pdf-specialist-skill)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: pdf-specialist-skill
description: >-
  Create, read, edit, analyze PDFs — forms, OCR, merge, split, convert,
  watermark, encryption, image extraction. Any PDF/.pdf mention. Not Word or
  spreadsheets.
license: Apache-2.0
compatibility: opencode
category: Framework
---

## What I do

- Extract text and tables (pdfplumber / `pdftotext`); merge, split, rotate, watermark, encrypt (pypdf / qpdf)
- Fill forms — fillable AcroForm fields via pypdf; non-fillable via text annotations with validated coordinates
- Create PDFs from scratch (reportlab); convert pages to/from images (poppler-utils); OCR scanned PDFs (pytesseract)

**Routing:** tier 4 of the office-doc extraction ladder — structured PDF data (forms, fillable fields, OCR-as-purpose) escalates here after markitdown/docling/image-analyzer prove insufficient.
**Use for:** any PDF/.pdf mention.
**NOT for:** Word documents (.docx → docx-creation-skill), spreadsheets (Excel/CSV), coding unrelated to PDFs.

## Prerequisites

`pip install pypdf pdfplumber reportlab pdf2image pytesseract` · poppler-utils + qpdf (`sudo apt-get install poppler-utils qpdf`; macOS `brew install poppler qpdf`) · LibreOffice via `scripts/soffice.py` (auto-configured on first run)

## Tool chain — house rules

| Task | Tool | House rule |
|------|------|------------|
| Merge/split/rotate/metadata/encrypt | pypdf (or qpdf CLI) | pypdf page indices are **0-based** |
| Text/table extraction | pdfplumber | preserves layout; coordinates `(x0, top, x1, bottom)` with **y=0 at TOP** of page |
| Create from scratch | reportlab | platypus flowables, not raw canvas, for multi-page docs |
| Batch CLI ops | qpdf, poppler-utils | `pdftotext -layout` preserves layout; `pdfimages` beats page rendering for image extraction |
| OCR | pytesseract + pdf2image | first resort when extraction returns garbage, `(cid:X)`, or empty text |
| Forms | house scripts below | never fill with unvalidated coordinates |

Per-task code recipes, JSON schemas, and CLI option catalogs: [`reference.md`](reference.md).

## House scripts

```bash
python scripts/check_fillable_fields.py <file.pdf>                    # branch point for form filling
python scripts/extract_form_field_info.py <in.pdf> <field_info.json>  # fillable-PDF field inventory
python scripts/extract_form_structure.py <in.pdf> form_structure.json # non-fillable structure (labels/lines/boxes)
python scripts/convert_pdf_to_images.py <file.pdf> <outdir/>          # also the verification pass
python scripts/check_bounding_boxes.py fields.json                    # validate boxes BEFORE filling
python scripts/fill_fillable_fields.py <in.pdf> <values.json> <out.pdf>
python scripts/fill_pdf_form_with_annotations.py <in.pdf> fields.json <out.pdf>
python scripts/soffice.py --headless --convert-to pdf document.docx    # LibreOffice conversions
```

## Reading / extraction workflow

1. Try `pdftotext -layout` (fastest plain text) or pdfplumber (coordinates, tables).
2. Garbage / `(cid:X)` / empty output → scanned PDF → OCR via pytesseract + pdf2image.
3. Tables → pdfplumber `extract_tables()` → DataFrames; adjust `snap_tolerance` / `intersection_tolerance` for complex layouts.

Gotchas: pypdf `extract_text()` loses layout — prefer pdfplumber when structure matters. Encrypted: `reader.is_encrypted` → `reader.decrypt(pw)`, or `qpdf --password=… --decrypt`. Corrupted: `qpdf --check` / `qpdf --fix-qdf`. Large files: process pages individually. Code patterns: [`reference.md`](reference.md).

## Creation workflow (reportlab)

- Use platypus (`SimpleDocTemplate` + `Paragraph` story) for anything multi-page; raw `canvas` only for one-off drawing.
- **Never Unicode sub/superscript characters (₀₁₂…, ⁰¹²…) — built-in fonts lack the glyphs and render as solid black boxes.** Use `<sub>`/`<super>` markup tags inside `Paragraph`; for canvas-drawn text, adjust font size and position manually.

Setup, styles, and multi-page patterns: [`reference.md`](reference.md).

## Form filling — complete these steps in order, do not skip ahead

1. `python scripts/check_fillable_fields.py <file.pdf>` — its output branches the workflow:
   - Fillable → **2A** · Non-fillable → **2B**

### 2A Fillable fields

1. `extract_form_field_info.py` → `field_info.json`: `field_id`, 1-based `page`, `rect` ([left, bottom, right, top]), `type` (text/checkbox/radio_group/choice); checkboxes carry `checked_value`/`unchecked_value`, radios `radio_options`, choices `choice_options`.
2. `convert_pdf_to_images.py` → analyze images to determine each field's purpose (convert PDF rects to image coords as needed).
3. Author `field_values.json` — `field_id` and `page` must match field_info exactly; checkboxes use `checked_value`, radios one of `radio_options` values. Schema: reference.md.
4. `fill_fillable_fields.py` — fix any reported field errors and re-run.

### 2B Non-fillable (text annotations)

1. `extract_form_structure.py` → labels (with coordinates), lines, checkboxes, row_boundaries.
2. Meaningful labels → **Approach A (structure-based, preferred)**: entry x0 = label x1 + 5; entry x1 = next label's x0 or row boundary; top = label top; bottom = row boundary line below. Use `pdf_width`/`pdf_height` and coordinates directly from form_structure.json.
3. Scanned / no usable labels → **Approach B (visual estimation)**: convert to images, identify fields roughly, then **zoom-refine** — `magick page.png -crop <W>x<H>+<X>+<Y> +repage crop.png` (~50px padding; use `convert` if `magick` is absent). **Add crop offsets back**: full_x = crop_x + offset_x, full_y = crop_y + offset_y. Author fields.json with `image_width`/`image_height` pixel coordinates.
4. `check_bounding_boxes.py fields.json` — fix ALL intersecting boxes and too-small-for-font boxes before filling.
5. `fill_pdf_form_with_annotations.py` — auto-detects PDF-vs-image coordinate system.
6. **Verify:** `convert_pdf_to_images.py` on the filled output; check placement visually. Mispositioned → Approach A: PDF-point origin check; Approach B: image-dimension/pixel match.

## Verification

- Forms: `check_bounding_boxes.py` passes pre-fill; filled PDF re-imaged and visually checked
- Extraction: `pdftotext` round-trip returns expected text
- Creation: output opens clean; page count/size as specified

> Removed 2026-09: per-task Python/CLI recipe dumps, form-JSON schema examples, option catalogs, duplicated library-selection prose, LibreOffice install walkthrough, and common-issue restatements — moved to reference.md or deleted.

Attribution

darellchua2darellchua2
View sourceMore from darellchua2 →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Context Fundamentals

Understand the components, mechanics, and constraints of context in agent systems. Use when designing agent architectures, debugging context-related failures, or optimizing context usage.

179001 votes

release-notes

Draft release notes and changelog entries from git history or merged PRs between two refs (tags/SHAs/branches), including breaking changes, migrations, and upgrade steps. Use when the user asks for release notes, changelog updates, or a GitHub Release draft.

1301 votes

docs-style-guide

Documentation style guide enforcer by @planetabhi. Applies and reviews the writing style guide when authoring or editing product documentation and tutorials. Use to check prose for voice, tense, word choice, inclusive language, formatting, code block, UI, Markdown, and number/date conventions.

11 votes

Caveman Help

Quick-reference card for all caveman modes, skills, and commands. One-shot display, not a persistent mode. Trigger: /caveman-help, "caveman help", "what caveman commands", "how do I use caveman".

1023330 votes

How It Works

Explain how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks "how does claude-mem work?" or "what is this thing doing?".

929660 votes
View all in documentation →