使用Google Docs gview在webview中加载PDF
我正在尝试使用Google Docs gview在我的网页浏览中加载pdf。 它正在加载查看器,但不显示pdf页面本身。 我已将此技术与其他项目(其他目标url)一起使用,没有任何问题,但我无法使用Google Docs Gview页面来处理此问题。 我用
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webview = (WebView) findViewById(R.id.webView1); webview.getSettings().setJavaScriptEnabled(true); webview.setWebViewClient(new MyWebViewClient()); HttpHelper httphelper = new HttpHelper(); String pdf = "https://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf"; String result = httphelper.GetPage(Uri.parse("https://docs.google.com/gview?embedded=true&url=" + pdf)); webview.loadDataWithBaseURL("https://docs.google.com", result, "text/html", "utf-8", "https://docs.google.com"); }
知道为什么这不适用于gview页面吗?
谢谢
mWebview.getSettings().setJavaScriptEnabled(true); String strPdf="https://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf"; mWebview.loadUrl("https://docs.google.com/gview?embedded=true&url=" + strPdf);
- Android:“意外的流结束”exception下载大文件
- Cordova插件 – 键盘事件Android
- Executor和PriorityBlockingQueue上的ASyncTask
- 无法解析构造函数ArrayAdapter(android.Content.Context,int,java.util.ArrayList )
- Android + MySQL使用com.mysql.jdbc.Driver
- 找不到ID 0x7f090005的视图
- Android蓝牙套装 – 计时
- android中给定语言环境的自定义日期格式
- 使用Joda-Time Library将字符串转换为Google Tasks API中的DateTime格式