How to display PDF on a PHP website without Flash / Adobe

I am not satisfied with the internal behavior of browsers displaying PDF files. I would like to provide my users with a simple but stylish view of PDF documents on my sites. Something like Scribd, but managed and unter full security and control on my server.

I could provide inline links to GoogleDocsViewer or ZohoViewer. Or convert PDF right after downloading it from SWFTools and show swf with your own PHP or HTML5.

In any case, somehow, after hours of reading and thinking, I'm just not happy with any of the above approaches.

Any suggestions?

+7
source share
2 answers

Take a look at the Google Docs Viewer. The following code will help you (untested):

<iframe src="http://docs.google.com/gview?embedded=true&url=PDF-URL" style="width:600px; height:500px;" frameborder="0"></iframe> 

Update 13.09.2016: Google has removed its generator. Despite this, you can still use the viewer by manually adding the extra url document to the URL above.

+2
source

I needed to do something similar, and finally, I chose to create images with ImageMagick, its work is exactly the same as the Google Viewer.

But, if you want, you can still try using PDF.js from Mozilla and want to replace the PDF browser plugin.

+2
source

All Articles