pdf-download-extract-fallback
Skill by HKUDS
Guides an AI assistant to download or open a PDF and extract its text, falling back from pdftotext to PyMuPDF when needed. Aimed at users who process manuals, handbooks and other documents in automated pipelines.
Install pdf-download-extract-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 ~/.claude/skills/pdf-download-extract-fallbackRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install pdf-download-extract-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 ~/.gemini/antigravity-cli/skills/pdf-download-extract-fallbackAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install pdf-download-extract-fallback in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
PDF Download and Extract with Fallback is an agent skill that walks an AI assistant through getting a PDF and pulling its text out. It covers two modes: downloading a PDF from a web URL with curl and a browser user-agent, or starting from a PDF already on local disk. The workflow checks that the file is a PDF using the file command, then tries pdftotext first and falls back to PyMuPDF (fitz) if that fails or gives poor results.
If no extraction method works, the skill says to document the failure, keep any partial content, and fill gaps from domain knowledge with clear labels and citations. It also includes a complete bash workflow script, a tool availability pre-check, install commands, and a table of common failure modes. The skill is aimed at users who process technical manuals, handbooks, or other PDFs in automated pipelines where reliability matters.
Written from the project's SKILL.md and checked against it.
What it can do
- Download PDF from URLFetches a PDF from a web address with curl, following redirects and using a browser user-agent.
- Local file processingStarts from a PDF already on disk and skips the download step.
- File type checkUses the file command to confirm the download is a PDF before extraction.
- pdftotext extractionExtracts text with pdftotext from poppler-utils as the primary method.
- PyMuPDF fallbackExtracts text with PyMuPDF (fitz) if pdftotext fails or gives poor results.
- Domain knowledge fallbackSupplements missing content from domain knowledge and marks what came from the source.
- Tool pre-checkChecks whether pdftotext and PyMuPDF are available before extraction starts.
- Failure mode guideLists common symptoms, causes and fixes such as empty extraction or garbled text.
What you need
- curl
- file command
- poppler-utils (pdftotext)
- PyMuPDF (pip install pymupdf)
- Python 3
Try asking
- Download this PDF from a URL and extract its text using the fallback steps.
- Extract the text from the manual.pdf file I have on disk.
- Check whether pdftotext and PyMuPDF are installed before extracting a PDF.
Good to know
- If extraction fails, the skill allows content from domain knowledge, which is not taken from the source document.
- The complete workflow script writes to fixed filenames: downloaded.pdf and extracted.txt.
- Password-protected or scanned PDFs may give empty extraction; the source suggests OCR tools or an accessible version.
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/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
.skill_id43 B -
SKILL.md9 KB
Alternatives to pdf-download-extract-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-download-extract-fallback: common questions
What does the PDF download and extract fallback skill do?
It guides an assistant to download a PDF from a URL or use a local file, then extract its text. If pdftotext fails, it tries PyMuPDF, and if both fail, it documents the failure and uses labeled domain knowledge.
Which tools does the skill use for text extraction?
The primary method is pdftotext from poppler-utils. The fallback is PyMuPDF (fitz), installed with pip install pymupdf.
What should I do if the downloaded file is not a PDF?
The skill says the URL may have redirected to an HTML error page, the file may be corrupted, or access may be blocked. It recommends checking the HTTP status and verifying the file with the file command.
How do I install pdf-download-extract-fallback?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is pdf-download-extract-fallback free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is pdf-download-extract-fallback safe to use?
It scores 90 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-download-extract-fallback?
Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.
