AgentStack
SKILL verified MIT Self-run

Pdf

skill-jarrettmeyer-skills-pdf · by jarrettmeyer

>-

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-jarrettmeyer-skills-pdf

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Pdf? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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.

brew install poppler

Step 1: Get PDF Metadata

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

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.

pdftotext "" -

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

pdftotext -layout "" -

Method B: pandoc (better for structured Markdown)

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

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:

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.

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

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.