PDF Manipulation on iPhone SDK

别来无恙 提交于 2019-11-30 14:15:30

问题


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?

As a minimum I need to be able to Search and goto a page number in a 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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/5234408/pdf-manipulation-on-iphone-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!