显示大型 PDF 文档 iPhone

发布于 2024-10-01 14:57:18 字数 318 浏览 0 评论 0原文

经过几个小时的谷歌搜索后,我想看看是否有人知道答案。

我有一个很大的 PDF 文件(30mb),我使用 UIWebView 来显示它,但是在尝试滚动页面时速度非常慢,并且当您旋转 iPhone/iPad 时,它无法在屏幕上正确绘制,直到您滚动为止几页。

所以我一直在研究使用 CGPDFDocumentRef 来显示 PDF。在我进一步讨论之前,有没有一种更简单的方法可以做到这一点,或者有任何示例/开源解决方案可以在我花很长时间尝试复制 UIWebView 或类似的东西来显示大型 PDF 之前做到这一点。

我想其他人也遇到过这个问题吗?

非常感谢您的帮助

After many hours of googling I thought I would see if anyone knew the answer.

I have a large PDF file (30mb) which I was using the UIWebView to display but it is painfully slow when trying to scroll through pages and when you rotate the iPhone/iPad it doesn't draw properly on the screen till you have scrolled through a few pages.

So I have been looking into using the CGPDFDocumentRef to display the PDF. Before I go any further is there an easier way to do this, or any examples/open source solutions to do this before I spend a long time trying to replicate the UIWebView or something similar to display a large PDF.

I assume someone else has had this problem?

Many thanks for any help

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

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

发布评论

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

评论(1

等往事风中吹 2024-10-08 14:57:18

我已经建造其中一个有一段时间了。我告诉你,这两种方法都有困难。 CGPDFDocumentRef 路径是我所采用的路径,并且效果非常好。

这里是一个很好的起点,以 Apple 为例, ZoomingPDFViewer< /a>.您将很好地了解 CGPDF* 的工作原理。如果您想快速组合一些东西,您可能需要从这个人的示例开始。事实上,作者网站提供了大量资源,供您在遇到问题时使用。

I've been building one of these for a while now. I'll tell you, both approaches have difficulties. The CGPDFDocumentRef path is the one that I've taken, and it's worked out pretty well.

A good place to start is here, with Apple's example, ZoomingPDFViewer. You'll get a good idea of how that CGPDF* stuff works. If you're looking to put something together in a hurry, you might want to start with this guy's example. In fact, the author's website has a huge list of resources to use when you run into problems.

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