如何在外部应用程序或Webview中打开pdf文件大小大于25mb [英] How to open pdf file in external app or in webview size is greater than 25mb
问题描述
您好,我想在Webview或外部应用程序中显示pdf文件.
1)我使用这个网址
https://docs.google.com/gview?embedded=true&url= +pdfurl
,但Google说警告预览文档时出现问题"
2)如果我使用意图在外部应用程序中打开URL,那么他们没有在外部应用程序中加载文件.
3)如果我使用意图在浏览器中打开URL,则开始下载pdf文件.
hello i want to show pdf file in webview or in external app.
1) i use this url
https://docs.google.com/gview?embedded=true&url= +pdfurl
, but google says "Whoops There was a problen while previewing document"
2) if i use intent to open the url in external app then they didnot load the file in external app.
3) if i use the intent to open the url in browser then its start downloading the pdf file.
Intent ii=new Intent(Intent.ACTION_VIEW);
ii.setDataAndType(Uri.parse(pdf),"text/html");
try {
startActivity(ii);
}catch (ActivityNotFoundException e)
{
Toast.makeText(QuranPara.this, "NO Pdf Viewer", Toast.LENGTH_SHORT).show();
}
这是完整的网址检查图像
推荐答案
要在WebView中显示它,请尝试类似
To show it in WebView try something like this
String pdf = "http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf";
webview.loadUrl("http://drive.google.com/viewerng/viewer?embedded=true&url=" + pdf);
要在浏览器中显示它,请尝试类似
To show it in browser try something like this
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(pdf_url));
startActivity(browserIntent);
这篇关于如何在外部应用程序或Webview中打开pdf文件大小大于25mb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!