【问题标题】:read local pdf through webview通过 webview 读取本地 pdf
【发布时间】:2012-03-13 05:31:18
【问题描述】:

我正在做一个应用程序来通过 webview 从 sdcard 读取 pdf。我使用了以下代码。

 webview = (WebView) findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.setWebViewClient(new HelloWebViewClient());
    File file = new File(Environment.getExternalStorageDirectory()
            + "/MotoronAug.pdf");
    Uri uri = Uri.fromFile(file);
    webview.loadUrl(uri.toString());

但我有一个空白页。但是当我给出一个网址时

webview.loadUrl("http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf");

我可以从 webview 读取它我的代码有什么问题?...我的 sdcard 中有 MotoronAug.pdf 文件。帮助我的朋友

【问题讨论】:

标签: android


【解决方案1】:

在线或本地都不会被 webview 渲染。

【讨论】:

  • 安卓有没有像iPhone中的quartzcore这样的框架来支持pdf阅读
  • 我不知道这个quartzcore是什么,但如果你必须检测pdf支持,请检查:stackoverflow.com/questions/4901104/…
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多