Daniel Södling
asked on
Force a PDF to open in an iframe
All,
I'm trying to create a page where I basically have list of links to PDF files and an iframe. When a user clicks on a link I want that PDF to be displayed in the iframe. I'm using angularjs for the page and when a user clicks on a link I simply reset the src attribute of the iframe to point to the selected PDF. This seems to work fine in some browsers but IE insists on asking me if I want to open or download the file.
Is this something that can be overridden? Can I force all browsers to open the PDF directly in the iframe or is this a browser setting?
Regards
Daniel Södling
I'm trying to create a page where I basically have list of links to PDF files and an iframe. When a user clicks on a link I want that PDF to be displayed in the iframe. I'm using angularjs for the page and when a user clicks on a link I simply reset the src attribute of the iframe to point to the selected PDF. This seems to work fine in some browsers but IE insists on asking me if I want to open or download the file.
Is this something that can be overridden? Can I force all browsers to open the PDF directly in the iframe or is this a browser setting?
Regards
Daniel Södling
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Firefox and Chrome and Opera have built-in PDF viewers. Last time I checked, IE does not and requires the Adobe reader add-on to open PDFs in the browser.
I just checked IE11 and since I installed Adobe Reader DC, it will also open in the browser. I don't know about other versions of IE and Adobe.
ASKER
Thanks!
I'll take a look at the js library.
I'll take a look at the js library.