split4pdf
CoderWanFeng/python-office/skills/pdf/split4pdf/SKILL.md
按指定页码范围拆分 PDF 文件。当用户提到 PDF 拆分、PDF 分割、PDF 切分、拆 PDF 时使用。
Skill1.4k starsChanged 2 months ago
What's in it
- split4pdf Skill
- 功能描述
- 所属分类
- 调用方式
- 参数说明
- 返回值
- 使用示例
- 视频教程
- 原始函数
---
name: split4pdf
description: 按指定页码范围拆分 PDF 文件。当用户提到 PDF 拆分、PDF 分割、PDF 切分、拆 PDF 时使用。
---
# split4pdf Skill
> 拆分 PDF 文件
## 功能描述
按指定页码范围拆分 PDF 文件。
## 所属分类
`office/skills/pdf/split4pdf/`
## 调用方式
```python
from skills.pdf import split4pdf
split4pdf(
input_file='./test.pdf',
output_file='./split.pdf',
from_page=0,
to_page=5
)
```
## 参数说明
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| `input_file` | str | 否 | - | PDF 文件路径 |
| `output_file` | str | 否 | `'./output_path/split_pdf.pdf'` | 输出拆分后的 PDF 文件路径 |
| `from_page` | int | 否 | `-1` | 起始页码(-1 表示从第一页开始) |
| `to_page` | int | 否 | `-1` | 结束页码(-1 表示到最后一页结束) |
## 返回值
`None`
## 使用示例
```python
from 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`
More agent context in CoderWanFeng/python-office
74 other files this repository gives its agents, the first 60 shown.
Skill
- excel2pdfskills/excel/excel2pdf/SKILL.md
- fake2excelskills/excel/fake2excel/SKILL.md
- find_excel_dataskills/excel/find_excel_data/SKILL.md
- merge2excelskills/excel/merge2excel/SKILL.md
- merge2sheetskills/excel/merge2sheet/SKILL.md
- sheet2excelskills/excel/sheet2excel/SKILL.md
- split_excel_by_columnskills/excel/split_excel_by_column/SKILL.md
- add_line_by_typeskills/file/add_line_by_type/SKILL.md
- file_name_add_postfixskills/file/file_name_add_postfix/SKILL.md
- file_name_add_prefixskills/file/file_name_add_prefix/SKILL.md
- file_name_insert_contentskills/file/file_name_insert_content/SKILL.md
- get_filesskills/file/get_files/SKILL.md
- group_by_nameskills/file/group_by_name/SKILL.md
- output_file_list_to_excelskills/file/output_file_list_to_excel/SKILL.md
- replace4filenameskills/file/replace4filename/SKILL.md
- search_specify_type_fileskills/file/search_specify_type_file/SKILL.md
- t0skills/finance/t0/SKILL.md
- add_watermarkskills/image/add_watermark/SKILL.md
- compress_imageskills/image/compress_image/SKILL.md
- decode_qrcodeskills/image/decode_qrcode/SKILL.md
- del_watermarkskills/image/del_watermark/SKILL.md
- down4imgskills/image/down4img/SKILL.md
- image2gifskills/image/image2gif/SKILL.md
- img2Cartoonskills/image/img2Cartoon/SKILL.md
- pencil4imgskills/image/pencil4img/SKILL.md
- txt2wordcloudskills/image/txt2wordcloud/SKILL.md
- excel2markdownskills/markdown/excel2markdown/SKILL.md
- VatInvoiceOCR2Excelskills/ocr/VatInvoiceOCR2Excel/SKILL.md
- add_img_waterskills/pdf/add_img_water/SKILL.md
- add_markskills/pdf/add_mark/SKILL.md
- add_text_watermarkskills/pdf/add_text_watermark/SKILL.md
- add_watermark_by_parametersskills/pdf/add_watermark_by_parameters/SKILL.md
- add_watermarkskills/pdf/add_watermark/SKILL.md
- decrypt4pdfskills/pdf/decrypt4pdf/SKILL.md
- del4pdfskills/pdf/del4pdf/SKILL.md
- encrypt4pdfskills/pdf/encrypt4pdf/SKILL.md
- merge2pdfskills/pdf/merge2pdf/SKILL.md
- pdf2docxskills/pdf/pdf2docx/SKILL.md
- pdf2imgsskills/pdf/pdf2imgs/SKILL.md
- txt2pdfskills/pdf/txt2pdf/SKILL.md
- merge4pptskills/ppt/merge4ppt/SKILL.md
- ppt2imgskills/ppt/ppt2img/SKILL.md
- ppt2pdfskills/ppt/ppt2pdf/SKILL.md
- change_label_in_xmlskills/ruiming/change_label_in_xml/SKILL.md
- screen_unmarked_imageskills/ruiming/screen_unmarked_image/SKILL.md
- screen_without_label_json_fileskills/ruiming/screen_without_label_json_file/SKILL.md
- courseskills/tools/course/SKILL.md
- create_articleskills/tools/create_article/SKILL.md
- lottery8ticketskills/tools/lottery8ticket/SKILL.md
- net_speed_testskills/tools/net_speed_test/SKILL.md
- passwordtoolsskills/tools/passwordtools/SKILL.md
- pwd4wifiskills/tools/pwd4wifi/SKILL.md
- qrcodetoolsskills/tools/qrcodetools/SKILL.md
- transtoolsskills/tools/transtools/SKILL.md
- url2ipskills/tools/url2ip/SKILL.md
- weatherskills/tools/weather/SKILL.md
- audio2txtskills/video/audio2txt/SKILL.md
- mark2videoskills/video/mark2video/SKILL.md
- txt2mp3skills/video/txt2mp3/SKILL.md
- video2mp3skills/video/video2mp3/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

