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.
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-fallbackRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install pdf-extract-ordered-fallback in Claude Code
git clone --depth 1 https://github.com/HKUDS/AgentPilot /tmp/AgentPilot && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/AgentPilot/openspace/benchmarks/gdpval/skills/pdf-download-extract-fallback-enhanced ~/.gemini/antigravity-cli/skills/pdf-extract-ordered-fallbackAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install pdf-extract-ordered-fallback in Antigravity CLI
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
ANo 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 →Creates importable JSON templates for the Obsidian Web Clipper. It is for users who want to clip a site, understand the available variables, or format clipped content.
Harness Creator builds, audits, and improves the instruction and state files that help AI coding agents stay reliable across sessions. It is for developers whose agents forget context, drift out of scope, or claim work is done too early.
Guides an assistant through extracting text from scanned PDFs, photographed pages, and images with OCR. Covers backends, language packs, force-OCR, and performance tuning.
Edits a named local file in place to remove AI-writing patterns, using minimal targeted changes and post-edit verification. Built for users who explicitly ask to clean, rewrite, or humanize that specific file.
Polishes, translates, or tightens existing academic manuscript prose while preserving facts, terminology, and evidence boundaries. Made for researchers revising drafts, including Chinese-to-English translation and LaTeX layout fixes.
Adds PDF form analysis and filling, table extraction, OCR, validation and batch processing to an AI assistant. Aimed at developers who run complex or high-volume PDF workflows.
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.
