在命令行上将Mac iWork文件批量转换为PDF [英] Batch convert Mac iWork files to PDF on the command line

查看:237
本文介绍了在命令行上将Mac iWork文件批量转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在命令行上将一堆各种各样的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.

推荐答案

嗯...您需要的东西

  1. 了解iWork文件格式,
  2. 可以渲染文档然后创建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,但也许您可以使用

I would use Applescript, but perhaps you can use Ruby and Python with the Scripting Bridge to accomplish what you need

借助Scripting Bridge,RubyCocoa和PyObjC脚本可以完成AppleScript脚本可以做到的事情:控制可编写脚本的应用程序并与它们交换数据.

With Scripting Bridge, RubyCocoa and PyObjC scripts can do what AppleScript scripts can do: control scriptable applications and exchange data with them.

我已经有一段时间没有使用脚本桥了,但是我相信您可以告诉应用程序打印文档.而且任何可以在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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆