Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to support PDF viewing for all mobile browser?

I am using

<object>

to embed a pdf file on my website. e.g.

<object data="abc.pdf" type="application/pdf">
    <embed src="abc.pdf" type="application/pdf" />
</object>

It works on all desktop browser, but on my android device, it does not show anything. Besides using the google pdf viewer (since it down-grade dramatically the pdf quality), are there any way to support all ios / android device browser? Or, what is the best way to handle this situation? Since there are lots of browser , How can I redirect them to the browser's pdf plugin download page , or should I just tell them to get one ? (Less user friendly). Thanks

like image 415
user782104 Avatar asked Nov 24 '22 15:11

user782104


1 Answers

The best way is just too just add a link to the abc.pdf it will open on a new tab. This would work best for mobile browser rather than embeding or implementing plugins.

<a href="abc.pdf" target="_blank">ABC PDF file</a>
like image 124
meda Avatar answered Jan 18 '23 02:01

meda