MuPDF Tools
$ mutool 官方出品 低风险MuPDF 的 mutool 提供 mutool info、mutool show、mutool draw、mutool extract、mutool merge 与 mutool clean 等子命令。它在页面渲染以及检查内嵌字体、图像和 PDF 对象方面远快于较重的 Java 或 PostScript 工具链。
brew install mupdf-tools 亚秒级 PDF 页面渲染(mutool draw)与资源检查(mutool info)直接在本地 shell 执行更高效。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
具备清晰的子命令结构(info、show、draw、merge、clean),完全非交互且无 ANSI 干扰,但输出为纯文本而非 JSON。
- Subcommands like
mutool infoandmutool showrun non-interactively - No
--jsonoutput flag
mutool info 与 mutool show 为严格只读;若未隔离目录,mutool extract 会直接将内嵌资源写入当前工作目录。
- Read-only inspection subcommands
mutool extractwrites into CWD unless run inside a dedicated output directory
轻量 C 二进制,可通过 Homebrew 的 mupdf-tools、Linux 发行版及官方跨平台包安装。
- Available via
brew install mupdf-tools
单工具集成极速页面渲染、文本/HTML/SVG 提取、PDF 合并与垃圾回收清理。
- Handles PDF, XPS, CBZ, and EPUB rendering and PDF manipulation
由 Artifex Software 官方维护,依托成熟的 MuPDF C 核心库持续发布。
- Maintained by Artifex Software alongside MuPDF
提供清晰的 mutool <subcommand> -h 帮助及在线 ReadTheDocs 子命令文档。
- Documented at mupdf.readthedocs.io
安全边界、鉴权与放权指南
无需凭据;加密 PDF 可通过 -p <password> 行内传入密码。
AGPL-3.0-or-later 开源;闭源商业分发需购买商业 OEM 许可。
# MuPDF Tools (mutool) Agent Rules - Inspect page count with `mutool info` before running `mutool draw` so large PDFs do not write hundreds of PNGs. - Always pass explicit `-o <output>` paths on `mutool merge`, `mutool clean`, and `mutool draw`.
Agent 高频安全命令配方
只读查询(安全推荐)
mutool info input.pdf
在不写入文件的前提下输出页数、页面框、字体与内嵌图像信息。
mutool show input.pdf trailer
将底层 PDF trailer 字典内容输出至标准输出以供结构排查。
受控写入与预演
mutool draw -r 150 -o page-%d.png input.pdf 1-3
以 150 DPI 将第 1–3 页栅格化为 page-1.png..page-3.png。
核心优势
- + PDF 页面渲染与结构检查速度明显快于 Java 或 Ghostscript 方案。
- + 直观的
mutool <subcommand>设计省去了晦涩的 PostScript 参数。
注意事项与踩坑点
- !
mutool extract默认将提取出的字体和图片直接输出到当前工作目录。 - ! AGPL-3.0 协议下,闭源分发需向 Artifex 购买商业许可。