如何访问PDF文档中的超链接(iPhone)?
是否可以使用 CGPDFDocument 或其他方式访问 PDF 文档中的“内部”链接? 我正在构建一个简单的阅读器应用程序,并希望以 PDF 形式提供我的内容,但如果我不能支持文档中页面之间的链接,这可能无法正常工作。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
请参阅我的回答此处。 基本上,您需要熟悉 PDF 链接注释。
See my answer here. Basically, you'll need to get familiar with PDF link annotations.
请参阅此示例代码...pdf 超链接在此
https://github.com/vfr/Reader中有效
see this sample code...pdf hyperlinks works in this
https://github.com/vfr/Reader
如果您使用 Quartz 打开并查看 PDF,然后是的,看起来您将有权访问内部链接。 Quartz 还可以让您 向 PDF 添加新链接。 我没有任何 iPhone/Mac 开发的第一手经验,但如果他们让你添加超链接,但不使用它们,那就很奇怪了。
If you're using Quartz to open and view a PDF, then yes, it looks like you will have access to internal links. Quartz will also let you add new links to PDFs. I don't have any first hand experience with iPhone/Mac development, but it would be quite strange for them to let you add hyperlinks, but not use them.
您需要分两步进行。
第一:解析 pdf 以找到标记的内容运算符
这是解析代码的示例:(
您需要完成并调整此代码以满足您的要求)
第二:响应 toucheEnded 消息以处理对这些区域的点击并使 UI 响应因此。
You need to do in two steps.
First: Parse your pdf to locate marked content operators
That's an exemple of a parsing code :
(You need to complete and adjust this code to match your requirement)
Second: respond to the toucheEnded message to handle tap on those zones and make the UI respond accordingly.