Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

pdf-extract-ordered-fallback

Skill by HKUDS

Extracts text from PDF files using an ordered fallback chain: read_file, then pdftotext via run_shell, then PyMuPDF via execute_code_sandbox. Built for workflows that download PDFs from web sources and need dependable text output.

  • Score 89
  • 8.1k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install pdf-extract-ordered-fallback

Built from the published package, never by AI.

git clone --depth 1 https://github.com/HKUDS/AgentPilot /tmp/AgentPilot && mkdir -p ~/.claude/skills && cp -r /tmp/AgentPilot/openspace/benchmarks/gdpval/skills/pdf-download-extract-fallback-enhanced ~/.claude/skills/pdf-extract-ordered-fallback

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install pdf-extract-ordered-fallback in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

pdf-extract-ordered-fallback is a skill that downloads PDFs from web sources and extracts their text. It runs a fixed tool order: read_file first, then run_shell with pdftotext, then execute_code_sandbox with PyMuPDF, and finally domain knowledge if extraction fails. The skill also covers downloading with curl using a browser user-agent and checking the file type with the file command.

The source says shell tools should be tried before Python sandbox execution, because the sandbox can return unknown errors in some environments. It includes a failure table, recovery patterns and a bash script covering the same steps. It is aimed at people who extract text from regulatory documents, technical manuals or handbooks in automated pipelines where access may be unreliable.

Written from the project's SKILL.md and checked against it.

What it can do

  • read_fileAttempts direct text extraction from a PDF as the first step.
  • run_shellRuns pdftotext as the primary extraction method when read_file fails.
  • execute_code_sandboxRuns PyMuPDF in Python as the secondary fallback extraction method.
  • Download with browser user-agentDownloads PDFs with curl, following redirects and sending a browser user-agent.
  • File type checkUses the file command to confirm the download reports a PDF document.
  • Domain knowledge fallbackDocuments the failure and supplements missing content, marking sourced and generated parts.

What you need

  • poppler-utils, which provides pdftotext
  • Python with the pymupdf package for the PyMuPDF fallback
  • curl for downloading PDFs
  • Access to read_file, run_shell and execute_code_sandbox tools

Try asking

  • Extract the text from this PDF: https://example.com/manual.pdf
  • Download this regulatory PDF and extract its text with pdftotext.
  • Pull the text from report.pdf and fall back to PyMuPDF if needed.

Good to know

  • execute_code_sandbox may fail with unknown errors in some environments
  • read_file may return binary or image data for scanned PDFs
  • Empty extraction can result from password-protected or scanned PDFs
  • Curl requests may be blocked by anti-bot measures

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: openspace/benchmarks/gdpval/skills/pdf-download-extract-fallback-enhanced/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • .skill_id52 B
  • SKILL.md10 KB

Alternatives to pdf-extract-ordered-fallback

All alternatives →

Compare with obsidian-clipper-template-creator, harness-creator or xberg-extracting-with-ocr

pdf-extract-ordered-fallback: common questions

Why does it try shell tools before Python?

The source says shell-based pdftotext is more reliable in constrained environments. It also notes that execute_code_sandbox can fail with unknown errors in some environments.

What happens if every extraction method fails?

The skill says to document the failure mode, extract any partial content, and supplement missing parts from domain knowledge. Generated portions should be clearly marked as separate from the source.

Does it handle scanned PDFs?

The source says read_file can return binary or image data for scanned PDFs, and the workflow then switches to pdftotext. For empty results from scanned or protected PDFs, it suggests OCR tools or requesting an accessible version.

How do I install pdf-extract-ordered-fallback?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is pdf-extract-ordered-fallback free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is pdf-extract-ordered-fallback safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to pdf-extract-ordered-fallback?

Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.

pdf-extract-ordered-fallback Install

Add to stack

Loading.