【问题标题】:MuPDF: clickListener on hyperlinksMuPDF:点击超链接上的监听器
【发布时间】:2014-01-01 02:48:10
【问题描述】:

我使用 mupdf 来查看 pdf 文件。 我使用this instructions构建了Android项目

但是我无法点击文本中的链接,例如url(突出显示,但查看器对点击没有反应)

点击pdf文件中的链接如何跳转?

我也对支持超链接的其他免费 Android pdf 库感兴趣。

【问题讨论】:

  • url(它被突出显示,但查看器对点击没有反应) - 可能 PDF 仅包含以突出显示方式显示 URL 的信息,而不是链接.

标签: android pdf mupdf


【解决方案1】:

我们在我们的 Android 可定制杂志应用中使用 muPDF 有一个类似的功能:可以“点击”文本中的链接,可以是外部链接,也可以是指向其他页面的链接。 这个应用程序是开源的,可以在Github 上找到。您应该很容易查看代码,并了解我们是如何实现此功能的。

【讨论】:

  • 嗨 librelio,我尝试了这个示例。内部链接正常工作。但外部链接(超链接)不工作。可能是什么原因?你有什么建议吗?
  • @user2894326 我们有许多应用程序在生产中,外部链接运行良好,所以没有理由这样做。随时在 Github 上发布问题,详细解释问题
  • 抱歉造成误会。我测试的pdf有一些问题。它在其他 pdf 中运行良好。谢谢
【解决方案2】:
"https://github.com/libreliodev/android" this link provides you pdf library which suppourts hyperlinks but it has lot other stuff, 
what you need to do is after downloading the zip from the link extract it and load it in eclipse  

1) create a activity and declare it in manifest 
public class MyActivity extends BaseActivity /** base activity is available in library itself **/


{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent resultIntent = new Intent(this, MuPDFActivity.class);
        resultIntent.setAction(Intent.ACTION_VIEW);
        resultIntent.setData(Uri.parse("give the path of your pdf location"));
        resultIntent.putExtra(Magazine.FIELD_TITLE, "Title");
        startActivity(resultIntent);
    }

}
it will load the pdf

【讨论】:

    猜你喜欢
    • 2018-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多