---
name: PDF
slug: pdf-2
category: Automation
description: PDF extracts text from PDF files using pypdf, with pdfminer.six as a fallback for CJK fonts. Use it when the source is a .pdf file or the user asks for a research paper.
github: "https://github.com/axoviq-ai/synthadoc/tree/main/synthadoc/skills/pdf"
language: Python
stars: 1012
forks: 122
install: "npx degit https://github.com/axoviq-ai/synthadoc/tree/main/synthadoc/skills/pdf ~/.claude/skills/pdf"
installs_to: ~/.claude/skills/pdf
source_path: synthadoc/skills/pdf/SKILL.md
collection_size: 10
category_size: 1523
collection_url: "https://dirskills.com/collections/axoviq-ai/synthadoc"
added: 2026-08-21T05:14:31.901Z
last_synced: 2026-08-21T05:14:31.901Z
canonical_url: "https://dirskills.com/skills/pdf-2"
---

# PDF

PDF extracts text from PDF files using pypdf, with pdfminer.six as a fallback for CJK fonts. Use it when the source is a .pdf file or the user asks for a research paper.

**Install:**

```bash
npx degit https://github.com/axoviq-ai/synthadoc/tree/main/synthadoc/skills/pdf ~/.claude/skills/pdf
```

## README

# 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
