i need to display a pdf on the website. i've tried many ways but none of it worked for me. let me explain what i've tried and why this is not ok for me.
- i tried to insert pdf into html with
<object>
and<embed>
tags. its ok if client browser has flash. but android phones don't have it so this is not a solution. plus iphone streching pdf so it is not readable. - then i tried to use just an
<iframe>
element. works fine only if browser has pdf plugin. in other cases browser starts file downloading. so this is not a solution too. - then i tried to use https://docs.google.com/gview?embedded=true&url=myfile.pdf. well and here i got troubles because there is some bug in in google docs because file displays only one in for times. the rest attempts ended with error code 200 from google. so as you already understood this is not a solution too.
- then i tried to download php libs which should convert pdf to html (or image) but none of them worked beacuse i'm not that good at php and sometimes it asked to install third party libs so at this point i've failed too.
so now i'm stuck. i need to do something to display pdf on the page. i need some crossbrowser/responsive solution. it would be great if you help me to find some service like https://docs.google.com/gview which is gonna work without bugs or suggest any other solution. may be some small php lib with good documentation.
any help appriciated!