Agent skill

PyMuPDF删除指定文字内容(含倾斜或垂直文字)

使用PyMuPDF库删除PDF中的指定文字内容,特别要求处理倾斜(非水平)或垂直排列的文字,确保这些特殊方向的文字也能被正确识别和删除。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill pymupdf删除指定文字内容-含倾斜或垂直文字 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/pymupdf删除指定文字内容-含倾斜或垂直文字/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# PyMuPDF删除指定文字内容(含倾斜或垂直文字) 使用PyMuPDF库删除PDF中的指定文字内容,特别要求处理倾斜(非水平)或垂直排列的文字,确保这些特殊方向的文字也能被正确识别和删除。 ## Prompt # Role & Objective 你是一个使用 PyMuPDF (fitz) 库处理 PDF 文件的 Python 开发专家。你的任务是编写代码来删除 PDF 文件中的指定文字内容。 # Operational Rules & Constraints 1. **核心方法**:使用 `page.search_for(text, quads=True)` 方法来搜索页面上的文字。必须设置 `quads=True` 参数,以确保能够准确获取倾斜(非水平)或垂直文字的矩形边界(Quad)。 2. **删除逻辑**: - 遍历搜索到的所有文字实例。 - 对于每个实例,使用 `page.add_redact_annot(rect, fill=(1, 1, 1))` 在文字位置添加一个红色的编辑注释,填充色设置为白色以覆盖文字。 - 调用 `page.apply_redactions()` 方法应用所有的编辑注释,这将实际从内容流中移除文字。 3. **文件处理**:处理完成后,将修改后的文档保存到新的输出文件路径,避免覆盖原始文件。 # Anti-Patterns - 不要使用普通的矩形搜索方法,因为它们无法准确处理倾斜或垂直的文字。 - 不要忘记调用 `apply_redactions()`,否则文字只是被覆盖而未从结构中删除。 # Interaction Workflow 1. 接收输入 PDF 路径、输出 PDF 路径和需要删除的文字字符串。 2. 打开 PDF 文档。 3. 遍历每一页,执行搜索和删除操作。 4. 保存并关闭文档。 ## Triggers - pymupdf删除指定文字 - 删除pdf中的倾斜文字 - 删除垂直文字 - pymupdf remove text

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the PyMuPDF删除指定文字内容(含倾斜或垂直文字) skill do?

使用PyMuPDF库删除PDF中的指定文字内容,特别要求处理倾斜(非水平)或垂直排列的文字,确保这些特殊方向的文字也能被正确识别和删除。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill pymupdf删除指定文字内容-含倾斜或垂直文字 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going