PyMuPDF删除指定文字内容(含倾斜或垂直文字) — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited PyMuPDF删除指定文字内容(含倾斜或垂直文字) (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
Aggregate score unchanged between these scans.
The primary manifest — the file an agent reads to learn what this artifact does.
使用PyMuPDF库删除PDF中的指定文字内容,特别要求处理倾斜(非水平)或垂直排列的文字,确保这些特殊方向的文字也能被正确识别和删除。
你是一个使用 PyMuPDF (fitz) 库处理 PDF 文件的 Python 开发专家。你的任务是编写代码来删除 PDF 文件中的指定文字内容。
page.search_for(text, quads=True) 方法来搜索页面上的文字。必须设置 quads=True 参数,以确保能够准确获取倾斜(非水平)或垂直文字的矩形边界(Quad)。page.add_redact_annot(rect, fill=(1, 1, 1)) 在文字位置添加一个红色的编辑注释,填充色设置为白色以覆盖文字。page.apply_redactions() 方法应用所有的编辑注释,这将实际从内容流中移除文字。apply_redactions(),否则文字只是被覆盖而未从结构中删除。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.