读取与处理 PDF——提取文本/表格、合并拆分、提取指定页。当用户涉及 PDF 文件处理时使用。需要本机 Python + pypdf / pdfplumber。
Scanned 9/6/2026
Install to Claude Code
npx -y skills add Ducktang123/claude-code-deepseek --skill pdf --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Pdf?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/ducktang123-pdf-claude-code-deepseek)More formats (shields.io, HTML) on the badges page.
---
name: pdf
description: 读取与处理 PDF——提取文本/表格、合并拆分、提取指定页。当用户涉及 PDF 文件处理时使用。需要本机 Python + pypdf / pdfplumber。
---
# PDF 处理
用 Python 处理 PDF。文本/表格提取用 `pdfplumber`,页面操作(合并/拆分/提取页)用 `pypdf`。通过 Bash/PowerShell 运行脚本。
## 前置
依赖库:`pypdf`、`pdfplumber`(安装包已自动装好;缺失则 `pip install pypdf pdfplumber -i https://pypi.tuna.tsinghua.edu.cn/simple`)。
## 常见任务
### 提取文本
```python
import pdfplumber
with pdfplumber.open("文件.pdf") as pdf:
for i, page in enumerate(pdf.pages, 1):
print(f"--- 第 {i} 页 ---")
print(page.extract_text() or "")
```
### 提取表格
```python
import pdfplumber
with pdfplumber.open("文件.pdf") as pdf:
for page in pdf.pages:
for table in page.extract_tables():
for row in table:
print(row)
```
### 合并 / 拆分 / 提取页
```python
from pypdf import PdfReader, PdfWriter
# 合并
w = PdfWriter()
for f in ["a.pdf", "b.pdf"]:
for p in PdfReader(f).pages: w.add_page(p)
with open("合并.pdf", "wb") as out: w.write(out)
# 提取第 1-3 页
r = PdfReader("文件.pdf"); w = PdfWriter()
for p in r.pages[0:3]: w.add_page(p)
with open("前三页.pdf", "wb") as out: w.write(out)
```
## 原则
- 扫描件(图片型 PDF)提不出文字,需要 OCR——遇到时如实告诉用户。
- 表格结构复杂时,先打印看清结构再处理。
- 处理完告诉用户输出文件路径。
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...
Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.
**Complete production-ready guide for Google Gemini embeddings API** This skill provides comprehensive coverage of the `gemini-embedding-001` model for generating text embeddings, including SDK usage, REST API patterns, batch processing, RAG integration with Cloudflare Vectorize, and advanced use cases like semantic search and document clustering. ---
Recovers prior coding-agent session context by running `catchup <agent> --since-compact`, which extracts a clean summary of a previous Codex, Claude Code, Antigravity, OpenCode, or Pi Agent session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", or asks to recover/summarize a previous session before continuing. Do NOT use for the current conversation, git history, or any non-agent log.