pdflisted
Install: claude install-skill MrSGSA/math-modeling-skill-dify
# PDF 工具
许可:专有;完整条款见 `LICENSE.txt`。
## Path safety
- Treat source PDFs as read-only and write new files under the user project directory.
- Do not overwrite an input file unless the user explicitly requests it and a recoverable copy exists.
- Resolve merge, split, OCR, form, watermark, encryption, and extraction targets before writing; never use the Skill directory as an output location.
- After any structural change, reopen the output, verify page count and key content, and visually inspect affected pages when layout matters.
- Relative filenames in the examples are placeholders under `PROJECT_ROOT`. Run from the project directory or replace them with resolved project paths; never run an example from the Skill directory when it can create output.
- 只有在用户有权访问该 PDF 且主动提供合法密码时才执行解密;不得猜测、破解、绕过或削弱访问控制。密码不得写入日志、文档元数据或默认命令历史。
- 不自动添加、删除或推断 AI 使用披露,也不把模型或厂商名写入默认作者、创建者或文档元数据;是否披露由用户依据适用规则决定。
## Overview
This guide covers essential PDF processing operations using Python libraries and command-line tools. For advanced features, JavaScript libraries, and detailed examples, see `reference.md`. If you need to fill out a PDF form, read `forms.md` and follow its instructions.
## Quick Start
```python
from pypdf import PdfReader, PdfWriter
# Read a PDF
reader = PdfReader("document.pdf")
print(f"Pages: {len(reader.pages)}")
# Extract text
text = ""
for page in reader.pages:
text += page.extract_text()
```
## Python Libraries
### pypdf - Basic Operations
#### Merge PDFs
```pytho