适用于 iPhone 的 PDF 查看/注释库?
我目前正在开展一个教育项目,我想向 iPhone 应用程序添加一些 PDF 阅读功能。我知道可以添加 UIWebView 并在那里显示 PDF,但是我想添加显示页码、“下一个”、“上一个”按钮等的功能。 CGPDFDocument 是我应该前进的方向还是有更好的(即功能更丰富的)库可用吗?我环顾四周,试图找到 CGPDFDocument 的功能,但除了 API 参考之外,没有太多可用的东西。
也可以用这个来注释pdf吗?
谢谢
太平绅士
I am currently working on an educational project where I would like to add some PDF reading functionality to an iPhone app. I know that it is possible to add a UIWebView and display the PDF there, however I would like to add the ability to show page number, 'next', 'previous' buttons etc. Is CGPDFDocument the direction that I should be headed or is there a better (ie more feature rich) library available? I have had a look around to try and find the capabilities of CGPDFDocument, but besides the API reference there is not much available.
Would it also be possible with this to annotate a pdf?
Thanks
JP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是 CGPDF 函数的一个很好的(有效的)示例:
http://www.olivetoast.com/blog /2009/08/simple-uiscrollview-catiledlayer-pdf-example/
它使用 CATiledLayer + UIScrollView,这可能不适合某种读者,但它仍然向您展示如何加载和绘制 PDF 文档没有 UIWebView (这严重限制了你的能力)。
将图层类型更改回图层,使用 CGPDFDocumentGetNumberOfPages 添加页面处理,然后使用 CGPDFDocumentGetPage,您就拥有了一个非常好的阅读器。
我不知道如何执行注释,我怀疑您需要在文档之上使用自己的数据结构。
Here is a good (working) example of the CGPDF functions:
http://www.olivetoast.com/blog/2009/08/simple-uiscrollview-catiledlayer-pdf-example/
It uses a CATiledLayer + UIScrollView, this may not be appropriate for a reader of sorts, but it still shows you how to load and draw a PDF doc without UIWebView (which severely restricts your abilities).
Change the layer type back to a layer, add in page handling using CGPDFDocumentGetNumberOfPages and then CGPDFDocumentGetPage and you have a pretty good reader.
I don't know how to perform annotations, I suspect you would need your own data structure on top of the document.
更新:2012 年 2 月 4 日
查看这个项目,它是开源的并且制作精良。
我认为这对于您的 PDF 阅读器来说可能是一个很好的起点。
项目:
http://www.vfr.org/
来源:
https://github.com/vfr/Reader
Update: 04 Feb 2012
Check out this project, it's opensource and very well made.
I think it could be a great starting point for your PDF reader.
Project:
http://www.vfr.org/
Source:
https://github.com/vfr/Reader
有PDF阅读器应用程序,这些应用程序不支持注释吗?
另一个角度可能是 iPhone 应用程序从互联网读取/下载页面(图像),其中可以添加基本注释(基于图像/图层),这些坐标可以保存到服务器。然后可以以编程方式将这些注释添加到服务器上的 PDF 中以供下载?
There are PDF reader apps, do these not support annotations?
Another angle could be for the iPhone app to read/download pages (images) from the internet, where one could add basic annotations to that (image/layer based), these coordinates could be saved to a server. Those annotations could then be added programatically to a PDF on the server for download?