OpenParable
Skip to content
← Back to skills

Split4pdf

Documents
split4pdf

Split4pdf is an Agent Skill for documents published in the CoderWanFeng/python-office repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

按指定页码范围拆分 PDF 文件。当用户提到 PDF 拆分、PDF 分割、PDF 切分、拆 PDF 时使用。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/CoderWanFeng/python-office/blob/HEAD/skills/pdf/split4pdf/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/split4pdf, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

split4pdf Skill

拆分 PDF 文件

功能描述

按指定页码范围拆分 PDF 文件。

所属分类

office/skills/pdf/split4pdf/

调用方式

from office.skills.pdf import split4pdf

split4pdf(
    input_file='./test.pdf',
    output_file='./split.pdf',
    from_page=0,
    to_page=5
)

参数说明

参数类型必填默认值说明
input_filestr否-PDF 文件路径
output_filestr否'./output_path/split_pdf.pdf'输出拆分后的 PDF 文件路径
from_pageint否-1起始页码(-1 表示从第一页开始)
to_pageint否-1结束页码(-1 表示到最后一页结束)

返回值

None

使用示例

from office.skills.pdf import split4pdf
# 拆分第 1-5 页
split4pdf(input_file='./report.pdf', output_file='./part1.pdf', from_page=0, to_page=4)

视频教程

https://www.python4office.cn/python-office/popdf/%E8%AF%BE%E7%A8%8B/4-split4pdf/

原始函数

office.api.pdf.split4pdf