PDF Processing
anthropics/skills
Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.
Picks the right Python library for PDF jobs, with examples for text and table extraction, merging, splitting and page extraction, plus OCR and memory fixes.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch pdf --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pdf .claude/skills/pdf && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "pdf" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/pdf into .claude/skills/pdf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/pdfType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch pdf --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/pdf .agents/skills/pdf && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pdf" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/pdf into .agents/skills/pdf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch pdf --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/pdf .cursor/skills/pdf && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pdf" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/pdf into .cursor/skills/pdf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/FareedKhan-dev/claude-code-from-scratch.git --path skills/pdf--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch pdf --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/pdf .gemini/skills/pdf && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pdf" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/pdf into .gemini/skills/pdf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install FareedKhan-dev/claude-code-from-scratch pdfInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/pdf .github/skills/pdf && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pdf" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/pdf into .github/skills/pdf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch pdf --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/pdf .opencode/skills/pdf && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pdf" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/pdf into .opencode/skills/pdf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pdfPicks the right Python library for PDF jobs, with examples for text and table extraction, merging, splitting and page extraction, plus OCR and memory fixes.
A short working guide for PDF tasks: extracting text or tables, merging, splitting, filling forms, adding watermarks or annotations, converting and searching. A decision tree maps each need to a library, with pdfplumber for text and tables from normal PDFs and pypdf for merging, splitting and page extraction, and code examples show each operation.
A troubleshooting section covers garbled or empty text from scanned files, which calls for OCR with pytesseract and pdf2image, tables that extract badly and can be tuned through pdfplumber table settings, and very large PDFs, which should be processed one page at a time. Installation is a pip install of pdfplumber and pypdf, with the OCR packages added when needed.
Read from SKILL.md and the folder at commit fb9709e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pipFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
PDF Library Guide loads about 785 tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 109 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from FareedKhan-dev/claude-code-from-scratch at commit fb9709e, republished under its MIT licence (© FareedKhan-dev). 109 words, ~785 tokens.
.claude/skills/pdf/SKILL.md (or your agent's skills folder).Load when the user asks you to:
Need to extract text from a normal (not scanned) PDF?
→ pdfplumber (best text + table extraction)
Need to manipulate pages (merge, split, rotate)?
→ pypdf (formerly PyPDF2)
Need to fill form fields?
→ pypdf with writer.update_page_form_field_values()
PDF is scanned (images of pages, no selectable text)?
→ pytesseract + pdf2image (OCR pipeline)
Need to create a PDF from scratch?
→ reportlab or fpdf2pip install pdfplumber pypdf
# For OCR:
pip install pytesseract pdf2image
# Also requires: tesseract-ocr (system package) and poppler-utilsimport pdfplumber
with pdfplumber.open("document.pdf") as pdf:
for page in pdf.pages:
text = page.extract_text()
if text:
print(text)import pdfplumber
with pdfplumber.open("document.pdf") as pdf:
for page in pdf.pages:
tables = page.extract_tables()
for table in tables:
for row in table:
print(row)from pypdf import PdfWriter
writer = PdfWriter()
for filename in ["part1.pdf", "part2.pdf", "part3.pdf"]:
writer.append(filename)
with open("merged.pdf", "wb") as f:
writer.write(f)from pypdf import PdfReader, PdfWriter
reader = PdfReader("document.pdf")
for i, page in enumerate(reader.pages):
writer = PdfWriter()
writer.add_page(page)
with open(f"page_{i+1}.pdf", "wb") as f:
writer.write(f)from pypdf import PdfReader, PdfWriter
reader = PdfReader("document.pdf")
writer = PdfWriter()
for page_num in [0, 2, 4]: # 0-indexed
writer.add_page(reader.pages[page_num])
with open("selected.pdf", "wb") as f:
writer.write(f)Text comes back garbled or empty The PDF may use a non-standard encoding or be scanned. Try OCR:
# pip install pdf2image pytesseract
from pdf2image import convert_from_path
import pytesseract
images = convert_from_path("scanned.pdf")
for img in images:
print(pytesseract.image_to_string(img))Tables not extracting correctly Try adjusting the extraction strategy:
page.extract_table(table_settings={"vertical_strategy": "lines",
"horizontal_strategy": "lines"})Large PDF crashes memory Process page by page, don't load entire PDF into memory:
with pdfplumber.open("large.pdf") as pdf:
for page in pdf.pages:
process(page.extract_text()) # one page at a time© FareedKhan-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/pdf of FareedKhan-dev/claude-code-from-scratch.
Open the folder on GitHubat commit fb9709e
PDF Library Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| PDF Library Guide this skillFareedKhan-dev/claude-code-from-scratch | 298 | — | ~785 | Automated safety check: Pass | MIT | |
| PDF Processinganthropics/skills | 180k | 48 repos | ~2k | Automated safety check: Pass | Proprietary | |
| PDF Processing with PythonHKUDS/DeepTutor | 41k | — | ~2.7k | Automated safety check: Pass | Apache-2.0 | |
| PDF ToolkitTokenRhythm/opensquilla | 7.1k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| PDF ToolkitXiaomiMiMo/MiMo-Code | 14k | — | ~1.7k | Automated safety check: Pass | Apache-2.0 | |
| PDF Generation, Forms and Extractionpipeshub-ai/pipeshub-ai | 3.8k | — | ~2.9k | Automated safety check: Pass | Apache-2.0 |
anthropics/skills
Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.
HKUDS/DeepTutor
Reads, extracts from, creates, merges, splits, watermarks, encrypts and fills PDF files with pdfplumber, pypdf and reportlab inside a Python sandbox.
TokenRhythm/opensquilla
Deterministic PDF operations through bundled scripts: extract text and tables, merge files or page ranges, split by range, fill form fields and build PDFs from data.
XiaomiMiMo/MiMo-Code
Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.
pipeshub-ai/pipeshub-ai
Picks the right library for generating a new PDF, filling an existing PDF form, or extracting text and tables, defaulting to Node where possible.
agentscope-ai/QwenPaw
Handles PDF tasks with Python libraries and command-line tools: extract text and tables, merge, split, rotate, create, fill forms and more.
FareedKhan-dev/claude-code-from-scratch
Gives patterns, a tool design checklist and an architecture decision tree for building agent harnesses, tools and multi-agent setups around a model.
FareedKhan-dev/claude-code-from-scratch
Gives the agent a five-step review routine that reads the full file first, labels each finding as bug, security, performance, style or suggestion, and ends with a summary.
Categories
Picks the right Python library for PDF jobs, with examples for text and table extraction, merging, splitting and page extraction, plus OCR and memory fixes. A short working guide for PDF tasks: extracting text or tables, merging, splitting, filling forms, adding watermarks or annotations, converting and searching. A decision tree maps each need to a library, with pdfplumber for text and tables from normal PDFs and pypdf for merging, splitting and page extraction, and code examples show each operation.
PDF Library Guide fits situations like: extracting text or tables from a PDF report; merging several PDFs into one file or splitting one apart; reading a scanned PDF that needs OCR.
Run `npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a claude-code`. Or copy the skill folder (skills/pdf in FareedKhan-dev/claude-code-from-scratch) into .claude/skills/pdf in your project. Claude Code loads it when a task matches its description.
Run `npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a codex`. Or copy the skill folder (skills/pdf in FareedKhan-dev/claude-code-from-scratch) into .agents/skills/pdf in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FareedKhan-dev/claude-code-from-scratch --skill pdf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf, .gemini/skills/pdf, .github/skills/pdf and .opencode/skills/pdf in your project.
Going by SKILL.md and its folder, PDF Library Guide needs the command-line tools its instructions call (pip). Our summary lists: Python with pdfplumber and pypdf; pytesseract and pdf2image for scanned PDFs.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
PDF Library Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 785 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with PDF Library Guide: PDF Processing (anthropics/skills, 180k stars), PDF Processing with Python (HKUDS/DeepTutor, 41k stars), PDF Toolkit (TokenRhythm/opensquilla, 7.1k stars) and PDF Toolkit (XiaomiMiMo/MiMo-Code, 14k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
FareedKhan-dev (a GitHub user) maintains it in FareedKhan-dev/claude-code-from-scratch, which has 298 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on April 5, 2026.
Source: FareedKhan-dev/claude-code-from-scratch on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.