Show PDF in iPad using CGPDF APIs [closed]

心已入冬 提交于 2019-11-28 18:27:38

In API documentation there is a way to load a PDF (with Quartz): CGPDFDocument is the object you need and CGPDFDocumentCreateWithURL is probably the constructor you are looking for.

Here are some examples on how to do it: http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html#//apple_ref/doc/uid/TP30001066-CH214-TPXREF109

I have spent a lot of time on this - and it seems you need to use CATiledLayers to zoom those PDFs properly!

There are some good examples on the net on how to do that...

I will put a link/solution here as soon as I have something ready!

Displaying the PDF with the Quartz APIs is pretty easy. But there's no native support for link annotations. Basically, you need to parse the "Annots" dictionary inside the pdf, and then find the correct page (which can be GoTo references, or named references, or ~10 other types; see the Adobe PDF Reference 1.7 document, the section about Actions), and the calculate the coordinates to the displayed page.

I've written a [commercial] library that includes parsing link annotations, and many more features. You may wanna check out http://pspdfkit.com

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