# PDF

Extract text from PDF documents

- Repository: https://github.com/axoviq-ai/synthadoc (1725 stars)
- Category: Documents
- License: AGPL-3.0-or-later
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add axoviq-ai/synthadoc --skill pdf -g -a claude-code -y`
Codex: `npx skills add axoviq-ai/synthadoc --skill pdf -g -a codex -y`
Cursor: `npx skills add axoviq-ai/synthadoc --skill pdf -g -a cursor -y`
Gemini CLI: `npx skills add axoviq-ai/synthadoc --skill pdf -g -a gemini-cli -y`

## Description

Extract text from PDF documents

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

