简体   繁体   English

在 WebView 中的 Android 中打开本地 PDF

[英]Open Local PDF in Android in WebView

Code代码

    webView = (WebView) findViewById(R.id.webView);
    webView.setWebViewClient(new WebViewClient());
    webView.getSettings().setSupportZoom(true);
    webView.getSettings().setJavaScriptEnabled(true);
    String url = "http://www.pdf995.com/samples/pdf.pdf";
    webView.loadUrl("https://docs.google.com/gview?embedded=true&url="+url);

This works pretty well when im trying to open an online pdf当我尝试打开在线 pdf 时,这非常有效

I want the user to choose a pdf in his phone and i want to open that pdf in webview.我希望用户在他的手机中选择 pdf,我想在 webview 中打开 pdf。 Is there a way to achieve this in android?有没有办法在 android 中实现这一点? I have the PDF Location.我有 PDF 位置。 Just want to open in只想打开

No, that's not possible.不,那是不可能的。 You can't do that.你不能那样做。 Read some websites first before creating apps.在创建应用程序之前先阅读一些网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM