如何在Android应用程序中打开PDF,并允许用户使用嵌入式超链接? [英] How can I open a PDF in an Android app and allow the users to use the embedded hyperlinks?

查看:748
本文介绍了如何在Android应用程序中打开PDF,并允许用户使用嵌入式超链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Android应用程序,该应用程序将下载和缓存PDF文件(这些文件用于发行杂志,而PDF格式是客户的要求).这些PDF文件将具有可链接到PDF中其他位置以及广告商网站的超链接,因此,使超链接正常工作很重要.在研究此问题时,似乎有两种方法可以实现向用户展示PDF:

I am creating an Android app that will download and cache PDF files (the files are for issues of a magazine and the PDF file format is the client's requirement). These PDF files will have hyperlinks that link to other locations in the PDF as well as advertisers' websites, so it is important that the hyperlinks work. In researching this problem, there seem to be two ways to implement presenting a PDF to a user:

  1. 要求用户拥有一个PDF查看应用程序,创建一个Intent并在第三方应用程序中启动PDF.
  2. 使用PDF呈现API在应用中本地显示PDF.

对于第一种方法,我尚未找到实现超链接的免费PDF查看应用程序. Adobe的Reader和其他软件(vuDroid,Android PDF查看器,droidreader甚至Google Docs)仅呈现PDF,但不会使链接可点击.有些应用程序似乎具有超链接支持(ezPDF,repligo,QuickOffice和Documents Go),这些应用程序不是免费的,但我的应用程序不能依靠用户付费来购买其他应用程序来显示PDF. 是否有任何免费的PDF查看应用程序支持我被忽略的超链接?

For the first method, I have yet to find a free PDF viewing app that implements hyperlinks. Adobe's Reader and others (vuDroid, android PDF viewer, droidreader, even Google Docs) only render the PDF but do not make the links clickable. There are apps that seem to have hyperlink support (ezPDF, repligo, QuickOffice and Documents to Go) that are not free, but my app can not depend on the user paying for another app to display the PDF. Are there any free PDF viewing apps that support hyperlinks that I've overlooked?

对于第二种方法,我已经看到了一些API的建议,这些建议中没有一个有充分的文档记录,也没有开箱即用的示例/教程来帮助开发人员理解如何使用它们.我看过muPDF,Android的itext端口,PDFbox和android PDF查看器源代码. 有人知道这些API之一(或我没有提到的一个)的简单示例吗?

For the second method, I've seen recommendations for a few APIs, none of which are well-documented or have examples/tutorials that work out of the box to help developers understand how to use them. I've looked at muPDF, the itext port to Android, PDFbox and the android PDF viewer source code. Does anyone know of a good, simple example of one of these APIs (or one I didn't mention)?

这些过程中的任何一个都可以正常工作,我只是陷入了两条道路.我已经读过,在构建用于本地渲染的应用程序时,很难使用PDF格式,因此我知道那里没有没有空闲的文件可以满足我的需求.感谢您的帮助!

Either one of these procedures would work fine, I've just gotten stuck going down both paths. I've read the PDF format is difficult to work with when building an app to render it natively, so I understand if there is nothing free out there that meets my needs. Thanks for the help!

推荐答案

终于找到了一个免费的支持超链接的PDF查看器! Qoppa Viewer 是一款免费的PDF查看应用程序,支持超链接.他们还具有 SDK (不是免费的),可能有助于构建此功能进入应用程序.只是想为以后发现此问题的其他人更新此信息.

Finally found a free PDF viewer that supports hyperlinks! Qoppa Viewer is a free PDF viewing app that supports hyperlinks. They also have an SDK (not free) that could be helpful in building this functionality into an app. Just wanted to update this for other people that find this question in the future.

这篇关于如何在Android应用程序中打开PDF,并允许用户使用嵌入式超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆