Agent skill
split-pdf
Split PDF files into separate single-page documents or extract specific page ranges. Use when you need to divide a PDF into multiple files, extract particular pages, or process PDF pages individually. Works with multi-page PDF documents.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/split-pdf
SKILL.md
Split PDF
将 PDF 文件拆分为多个单页文件或提取指定页面范围。
使用场景
- 将多页 PDF 拆分为独立的单页文件
- 提取 PDF 的特定页面范围
- 需要单独处理 PDF 各个页面时
使用方法
使用 scripts/split-pdf.cs 脚本进行 PDF 拆分:
拆分所有页面
dotnet scripts/split-pdf.cs input.pdf output-dir/
拆分指定页面范围
# 拆分第 1-5 页
dotnet scripts/split-pdf.cs input.pdf output-dir/ 1-5
# 拆分第 10-20 页
dotnet scripts/split-pdf.cs input.pdf output-dir/ 10-20
示例
# 将 document.pdf 的所有页面拆分到 pages/ 目录
dotnet scripts/split-pdf.cs document.pdf pages/
# 只提取前 3 页
dotnet scripts/split-pdf.cs document.pdf output/ 1-3
输出格式
拆分后的文件命名格式:{原文件名}_page_{页码}.pdf
例如,拆分 report.pdf 后会生成:
report_page_001.pdfreport_page_002.pdfreport_page_003.pdf- ...
依赖项
脚本使用以下 NuGet 包(已在脚本中声明):
- PdfSharpCore 1.3.65 - PDF 操作核心库
- Spectre.Console 0.49.1 - 美化的控制台输出
注意事项
- 页码从 1 开始计数
- 如果指定的页面范围超出实际页数,会自动调整到有效范围
- 输出目录不存在时会自动创建
- 支持中文文件名和路径
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?