# Pdf

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-jarrettmeyer-skills-pdf`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [jarrettmeyer](https://agentstack.voostack.com/s/jarrettmeyer)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [jarrettmeyer](https://github.com/jarrettmeyer)
- **Source:** https://github.com/jarrettmeyer/skills/tree/main/plugins/jarrettmeyer/skills/pdf

## Install

```sh
agentstack add skill-jarrettmeyer-skills-pdf
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# PDF Reader

The Read tool frequently fails on PDFs in this environment — false "exceeds 20 MB" errors
on small files and empty content returns. Do not stop at the first failure. Work through
the fallback chain until you have usable text.

## Prerequisites

The `pdfinfo`, `pdftotext`, and `pdftoppm` commands come from the **poppler** package.

```bash
brew install poppler
```

## Step 1: Get PDF Metadata

Before extracting text, check what you're dealing with:

```bash
pdfinfo ""
```

This gives you page count, file size, encryption status, and format info. Use it to set
expectations for the user (e.g., "This is a 15-page document").

## Step 2: Extract Text

Try each method in order. Stop at the first one that produces usable text.

### Method A: pdftotext

The most reliable method for text-based PDFs.

```bash
pdftotext "" -
```

This prints extracted text to stdout. If the document has tables or columns, try with the
`-layout` flag to preserve spatial formatting:

```bash
pdftotext -layout "" -
```

### Method B: pandoc (better for structured Markdown)

If you need Markdown output with headings, lists, and structure preserved:

```bash
pandoc "" -t markdown
```

Pandoc uses pdftotext internally but produces better-structured output. Prefer this when
the user wants a Markdown conversion.

### Method C: Read tool

Try the built-in Read tool on the PDF path. This sometimes works but frequently fails on
this platform. Only use as a fallback if the CLI tools above fail.

### Method D: OCR (scanned / image-based PDFs)

If pdftotext returns empty or near-empty output, the PDF likely contains scanned images
rather than text. Use tesseract for OCR:

```bash
tmpdir=$(mktemp -d)
pdftoppm "" "$tmpdir/page" -png
for img in "$tmpdir"/page-*.png; do
  tesseract "$img" - 2>/dev/null
done
rm -rf "$tmpdir"
```

### Method E: Report failure

If all methods fail, tell the user clearly: "I couldn't extract text from this PDF. The
file may be encrypted, corrupted, or in an unusual format." Suggest they try opening it
in a PDF viewer and copying the text manually.

## Step 3: Do What the User Asked

Once you have the extracted text:

- **Summarize / analyze / answer questions**: Work with the text directly in conversation
- **Convert to Markdown**: Use `pandoc "" -t markdown` for the best structure.
  Write the `.md` file next to the PDF with the same base name, unless the user specifies
  a different path
- **No specific ask beyond "read this"**: Present a brief summary of the document and ask
  what they'd like to do with it

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [jarrettmeyer](https://github.com/jarrettmeyer)
- **Source:** [jarrettmeyer/skills](https://github.com/jarrettmeyer/skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jarrettmeyer-skills-pdf
- Seller: https://agentstack.voostack.com/s/jarrettmeyer
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
