iPhone SDK上的PDF操作 [英] PDF Manipulation on iPhone SDK

查看:84
本文介绍了iPhone SDK上的PDF操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读Apple的文档,他们建议使用UIWebView。这一切都很好,直到您想要转到页码并搜索PDF文件。

I have been reading Apple's docs and they recommend using UIWebView. This is all well and good until you want to go to a page number and also search PDF's.

是否有任何第三方库(免费或付费)执行此操作在所有?

Is there any 3rd Party libraries, (free or paid) that do this at all?

至少我需要能够以PDF格式搜索和转到页码。

As a minimum I need to be able to Search and goto a page number in a PDF.

I看起来并且PDFKit不可用,Quartz方法似乎有限。由于应用程序商店中可用的PDF阅读器数量,这显然是可能的。

I have looked and PDFKit is not available and the Quartz methods seem limited. This is obviously possible due to the amount of PDF readers available on the app store.

推荐答案

可以做所有这些只是使用Quartz调用。 Quartz显然是基于C语言的,因此需要花一点时间来调整方括号的缺失,但是功能被清楚地命名并且不难理解。例如,您可以使用CGPDFDocumentGetNumberOfPages(),CGPDFDocumentGetPage()和CGContextDrawPDFPage()来显示文档中的给定页面。在这里搜索PDF有一个很好的解释:随机创意

It's possible to do all that just using the Quartz calls. Quartz is obviously C-based, so it takes a moment to adjust to the lack of square brackets, but functions are named clearly and it's not too hard to figure out. For example, you can use CGPDFDocumentGetNumberOfPages(), CGPDFDocumentGetPage(), and CGContextDrawPDFPage() to display a given page from a document. There's a nice explanation of searching a PDF here: Random Ideas

这并不是说第三方框架是个坏主意 - 如果有人已经完成了这项工作以使这一切变得简单,那就太好了。但如果你找不到适合自己的东西,不要害怕深入研究Quartz - 这不错。

None of this is to say that a 3rd party framework is a bad idea -- if someone has already done the work to make this all easy, then great. But if you don't find something that suits you, don't be afraid to dig into Quartz -- it's not bad.

这篇关于iPhone SDK上的PDF操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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