# PDF

> Extract text from PDF documents

- Skill: `gabrielmoreira/pdf-3` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gabrielmoreira/pdf-3`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gabrielmoreira/pdf-3/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- License: AGPL-3.0-or-later
- Author: gabrielmoreira (https://skillmd.com/u/gabrielmoreira)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/gabrielmoreira/pdf-3

---


# PDF Skill

Extracts text from PDF files using `pypdf` as the primary parser, with
`pdfminer.six` as a fallback for CJK fonts that pypdf cannot decode
(detected when pypdf yields fewer than 50 characters per page on average).

## Setup

```bash
pip install pypdf pdfminer.six
```

## Standalone usage

```python
import asyncio
from synthadoc.skills.pdf.scripts.main import PdfSkill

skill = PdfSkill()

async def main():
    result = await skill.extract("/path/to/paper.pdf")
    print(result.text)          # extracted text from all pages
    print(result.metadata)      # {"pages": N, "cjk_fallback": bool, ...}

asyncio.run(main())
```

## When this skill is used

- Source path ends with `.pdf`
- User intent contains: `pdf`, `research paper`

## Scripts

- `scripts/main.py` — `PdfSkill` class

## References

- `references/cjk-notes.md` — notes on CJK font handling

