Embed the PDF in a webpage without using the built-in PDF viewer

user782104 picture user782104 · Aug 23, 2013 · Viewed 73.9k times · Source

Currently I am using the standard way to embed an pdf to the browser, however, the built-in pdf viewer for my target browser is not working as expected. I would like to force (Chrome, Firefox and IE8 (if possible, but IE9+ is also ok)) to use the adobe reader. The problem is , I can only change this option manually. Is there any way to change the option in HTML/ JS/ PHP ? Thanks.

<OBJECT data="YourFile.pdf" TYPE="application/x-pdf" TITLE="SamplePdf" 
WIDTH=200 HEIGHT=100>
    <a href="YourFile.pdf">shree</a> 
</object>

I try to find the solution and someone suggested header, not working unfortunately e.g.

Content-Type: application/pdf
Content-Disposition: inline; filename.pdf

Answer

Bradly Spicer picture Bradly Spicer · Aug 29, 2013

I did this a while ago. Using JQuery was a great way to get round this :)

pdf.js:

https://github.com/mozilla/pdf.js

Hope this helps!