How to display a PDF file?

I tried to display a PDF file using WebView using the following code -

webview.loadUrl("http://www.mywebsite.co.uk/floorplan.pdf");  

or

Uri uri = Uri.parse("http://www.mywebsite.co.uk/floorplan.pdf");    
Intent intent = new Intent(Intent.ACTION_VIEW, uri);  
startActivity(intent);  

Using either I canโ€™t get the PDF to display if I didnโ€™t run it through Adobe (so my application downloads it), which then looks good. How can I get PDFs to display using Adobe through my application, or am I better off displaying PDF as an image?

+3
source share
1 answer

You will need to create a pdf viewer to display it inside your application. It is best to run Intent, as you do, to display it in an external pdf view.

Check this question out for more.

Show PDF in Android

+3
source

Source: https://habr.com/ru/post/1792845/


All Articles