I am writing from my Android. On my laptop, it's pretty simple to choose to open a PDF file directly in the browser rather than opening it in an external program. The problem comes when I try to open it on Android. I am usually asked to download it and it will open with PDF Viewer. I would like it to open directly in Chrome because - moreover -- I'd like to get a link to the PDF file. Usually, on Android, you can link the website and then the receiver will have to download the PDF so that he can view it. I would like to be readable directly in the browser.
16.3k 10 10 gold badges 75 75 silver badges 126 126 bronze badges asked Oct 13, 2020 at 15:02 Francesco Alessandro Francesco AlessandroAs far s I know if a PDF file can be displayed directly in the web browser or not depends on certain HTTP response headers that the server sends (or not). This is the same for all web browsers, some PDF files are shown in the web browser, and others can only be downloaded and saved.
Commented Oct 15, 2020 at 7:29 Commented Apr 20, 2021 at 11:46You can use a Google Docs page to view PDF files in the browser. To do this, visit the page https://docs.google.com/viewerng/viewer?url=http://yourfile.pdf, where http://yourfile.pdf is the path to the PDF file you want to view (credits to this answer).
Unfortunately, there is as far as I know no way to do this automatically in Chrome (you can always paste the URL manually every time you want to open a PDF file but that's not very practical). However, if you use a browser that supports extensions, it's possible to use an extension to automatically redirect PDF files to this URL. Unfortunately, you can't do this on any well-known browsers (Chrome and Edge for Android don't support extensions at all, and Firefox for Android only supports a very limited set of extensions), but there are less well-known browsers where you can do this. The one I use is Kiwi (I have no association with its author).
Once you've installed Kiwi (or another browser that supports Chrome extensions), install the Redirector extension (I have no association with its author). Next, click on the three dots on the top right, scroll down, click "Redirector", then click on the "Edit Redirects" button, and then click on "Create new redirect":
That will open a popup with five text boxes and two checkboxes. Enter the following information:
When you're done entering all that, it should look like this:
Now click Save and you're done. Now all PDF files will be opened in the browser like this: