获取 mutool 输出 "structured text (as xml)"

Get mutool to output "structured text (as xml)"

遵循 draw 命令的 mutool 说明
https://mupdf.com/docs/manual-mutool-draw.html

当输出 "vector formats" 之一是 "debug trace (as xml)" 和 "output format is inferred from the output filename" 时,如何输出 "structured text (as xml)" ?

如果我运行

mutool draw -o "testfile.xml" "testfile.pdf"

看来我得到了 "debug trace (as xml)" 文件格式。

我应该使用什么文件扩展名来确保输出"structured text (as xml)"格式?

如果您 运行 "mutool draw" 不带任何参数,则用法消息会告诉您支持哪些格式,以及它们的文件扩展名是什么。

在您的情况下,您需要 "stext" 输出。

mutool draw -o out.stext input.pdf
mutool draw -F stext -o out.xml input.pdf

或者如果您更喜欢 "mutool convert" 命令,它支持使用 -O 参数的高级输出选项。

mutool convert -o out.stext input.pdf