0

我想使用谷歌阅读器加载存储在我的资产中的 pdf 文件。这就是我想要做的:

uri file= Uri.parse("file:///android_asset/ganesh.pdf"); webView.loadDataWithBaseURL(null,"" + "http://docs.google.com/viewer?url=" + file + "&embedded=true" + " alt=\"pageNo\" width=\"100%\" height=\"80%\">", "text/html", "UTF-8", null);

在上述情况下,谷歌阅读器无法找到文档。但是,如果我使用以下“url”而不是“file”,它会显示指定的文档。

字符串 url = " http://www.mysite.com/pdf2/ganesh.pdf ";

提前致谢!

4

0 回答 0