Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a PDF via Android web browser without "downloading" first

Is there a way to get the stock Android browser to auto-open a PDF, Word or other typical file without having to go through the process of downloading the file and then getting the user to open the file from the Downloads app or the Notification bar?

We have a web application that has a lot of documents that we'd like to include and not have to convert to HTML, but making the user download the file and manually open it is not easy to train users on.

On iOS, these files all display inline in the browser. I'd like a way to get the browser to auto-launch the files into Acrobat Reader or QuickOffice or whatever program the user has to display them.

Does anyone know a way to do that? I know that Google Docs has some PDF viewing support, but people using our web app may not have public Internet access in all cases, and may be hitting on a local web server.

like image 780
Chris Saldanha Avatar asked Sep 15 '11 21:09

Chris Saldanha


People also ask

How do I view PDF in mobile without downloading it?

Google Drive Viewer allows files to be viewed (without downloading) in Google Chrome for Android. By default, the file will open in a new tab.

How do I display PDF in browser instead of downloading?

At the top right, click More Settings. At the bottom, click Show advanced settings. Under “Privacy”, click Content settings. Under “PDF Documents," check the box next to "Open PDF files in the default PDF viewer application.” (Uncheck this box if you want PDFs to open automatically when you click them.)

How do I view PDF in Android browser?

Navigate to the file manager on your Android device and find a PDF file. Any apps that can open PDFs will appear as choices. Simply select one of the apps and the PDF will open. Again, if you don't already have an app capable of opening PDFs, there are several you can choose from.


1 Answers

You can open a file PDF in Google Docs Viewer by appending the URL to:

http://docs.google.com/gview?embedded=true&url=<URL of a supported doc> 

This would open a PDF file in the default browser or a WebView.

A list of supported formats is given here.

like image 199
arsalank2 Avatar answered Oct 03 '22 09:10

arsalank2