frgr
frgr

Reputation: 65

How to display a PDF via Android web browser without downloading the file

I have to display a pdf from URL. When i directly open the url in a webview then it asks me to download the pdf and then view based on the app that i want to use to view it. But I do not want to download the pdf, it must be just displayed directly.

Some answers that I went through on SO recommended to make use of docs.google.com

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

But this doesnt seem to be working anymore.

Upvotes: 1

Views: 7100

Answers (2)

IAmJason
IAmJason

Reputation: 1

use this inside your body tags

    <iframe src="http://example.com/yourpdf" width="100%" height="100%" style="border: none;">This browser does not support PDFs. Please download the PDF to view it: <a href="http://example.com/yourpdf">Download PDF</a></iframe>

Upvotes: 0

Related Questions