问题描述
我正在尝试在命令行上将一堆各种各样的iWork文件(数字,页面,主题演讲)批量转换为PDF.
I'm trying to batch convert a bunch of assorted iWork files (Numbers, Pages, Keynote) to PDF on the command line.
我一直在尝试cups-filter,但是iWork类型没有MIME类型过滤器.然后,我研究了使用qlmanage生成预览图像并使用该图像,但这似乎不适用于多文件Keynote文档,因为它们以HTML而不是PDF的形式生成.
I've been trying cups-filter but there's no MIME type filter for the iWork types. I then looked into using qlmanage to generate the preview image and use that, but this doesn't seem to work for multi file Keynote documents as they generate as HTML rather than PDF.
有什么建议吗?我宁愿不求助于AppleScript.
Any suggestions? I'd rather not resort to AppleScript.
推荐答案
嗯...您需要的东西
- 了解iWork文件格式,
- 可以渲染文档然后创建PDF.
除非您想重新发明iWork套件,否则,将iWork应用告诉您想要的东西听起来更简单.
Unless you want to re-invent the iWork suite... Sounds simpler to just tell the iWork apps what you want from them.
您可以通过脚本执行此操作桥
我会使用Applescript,但也许您可以使用 Ruby和Python 与脚本桥完成所需的操作
I would use Applescript, but perhaps you can use Ruby and Python with the Scripting Bridge to accomplish what you need
我已经有一段时间没有使用脚本桥了,但是我相信您可以告诉应用程序打印文档.而且任何可以在OS X中打印的应用程序都可以将其发送为PDF.
I haven't used the Scripting Bridge in a while, but I believe you can tell applications to print documents. And any application that can print in OS X can send it to PDF instead.
这篇关于在命令行上将Mac iWork文件批量转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!