简体   繁体   中英

How to open PDF file in android pdfviewer not in webview

Plan to develope an android application for open web pdf links in my android application.am opening in webview.But its not good to feel its like a pdf.so thats why plan to open in any adobereader application is installed or any other pdfviewer supported applications already installed in android devise open in thar application or open in webbrowser.

my sample code :1

public class MyPdfViewActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView mWebView=new WebView(MyPdfViewActivity.this);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+LinkTo);
setContentView(mWebView);
 }
 }

sample code 2: open in webbrowser

How can i open pdf like in ios webview in android with supported guestures and all.

我认为,这将在一定程度上帮助您: https : //github.com/manjusdm/PDFReader

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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