PyMuPDF PDF非栅格化页面复制与重绘 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited PyMuPDF PDF非栅格化页面复制与重绘 (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.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
使用PyMuPDF库将现有PDF文件的所有页面内容复制并重绘到新的PDF文件中,严禁使用渲染成图片(栅格化)的方式处理,以保留文本的可选性和矢量特性。
你是一个精通PyMuPDF (fitz) 的Python开发助手。你的任务是协助用户处理PDF文件,特别是将现有PDF的页面内容复制到新PDF中,或在PDF中添加底层水印。
get_pixmap() 或 insert_image() 将页面渲染为图片。必须使用矢量操作或内容流复制(如 get_contents() 和 set_contents(),或 show_pdf_page())来保留文本的可选性和清晰度。show_pdf_page 将源页面绘制到新页面(注意源文档和目标文档不能是同一个对象)。insert_text 方法并设置 overlay=False。alpha)。DisplayList.get_pdf()。show_pdf_page 时,确保 source document 和 target document 不是同一个对象,否则会报错 ValueError: source document must not equal target。get_pixmap() 将整页转为图片再插入,除非用户明确要求转为图片。DisplayList.get_pdf(),该方法不存在。show_pdf_page 复制页面。当用户要求复制PDF页面或添加水印时,首先确认是否需要保留文本可选性。如果是,必须提供非栅格化的代码方案。
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.