编写一个简单的应用程序将文件转换为 pdf

发布于 2024-09-13 11:05:11 字数 324 浏览 0 评论 0原文

我想在 Mac 上创建一个应用程序,将多个文件(txt、pdf、doc、html 等)转换为可以打印的单个 pdf 文件。真正的要点是,如果您有 50 个文本,则不必打开每个文件并单击 command-p。

我不太确定最好的方法是否是创建一个成熟的应用程序或自动化插件(或其他东西)。如果我没记错的话,Mac os 的终端中有一个过滤器可以将文件转换为 pdf(但我忘了它叫什么)。

那么自动化插件可以很好地做到这一点,还是我应该为此制作一个应用程序?您能为我提供每个答案的优点吗?

我以前做过cocoa touch 编程,所以我可以很好地编写objective-c。

I want to create an application on a Mac to convert multiple files (txt, pdf, doc, html, etc) to a single pdf file that can be printed. The real point is that if you have 50 texts you don't have to open every single file and click command-p.

I'm not quite sure whether the best way to do this is by creating a full-fledged app or an automator plugin (or something else). If I remember correctly there's a filter in mac os's terminal that can convert files to pdf (but I forgot what it's called).

So would an automator plugin do this well, or shall I make an app for this? Can you provide me advantages for each answer?

I've done cocoa touch programming before so I can write objective-c quite well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

耳根太软 2024-09-20 11:05:12

使用 appscript,可以作为自动化脚本中的操作,也可以独立使用。优点是它非常简单,只需花费您一小部分时间即可编写应用程序。

这里非常接近您想要的内容。它设置一个拖放文件夹,并打印拖到其上的每个文件(您可以使用多重选择来获取您想要的内容)。它使用 Apple Works 6,但不支持您想要的文件类型。

要修改它以使用预览应用程序,您需要更改脚本中的tell命令,然后在Google上搜索预览词典以检查要使用哪个动词进行打印。

Use appscript, either as an action in an automator script or standalone. The advantage is that it is very simple and will take you a fraction of the time to write an app.

Here is something very close to what you want. It sets up a drop-folder and each file dragged onto it is printed (you can use multiple-select to get what you want). It uses Apple Works 6 which doesn't support the file-types that you want.

To modify it to use the Preview application instead you need to change the tell command in the script and then google the dictionary for Preview to check which verb to use for printing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文