The problem can be reproduced by putting a style position: relative
in the element html
of the page to be included on iframe
.
One of the solutions is to remove this style, but as sometimes you have no control over it, another solution is to add a style position: relative
at the iframe
.
iframe {
position: relative;
}
Response obtained in the OS.
EDIT
Remember that when you open the PDF in the browser in a new tab, it uses some add-on to read the file, such as adobe Reader.
A very easy way to use a iframe
to display the PDF is display it through Google Docs. You just need to change your src
for something like this:
http://docs.google.com/viewer?url=urlDoPDF&embedded=true
Change the parameter url
to your PDF url (localhost does not work, PDF has to be online). Remember to escape the fields using some function, such as the encodeURIComponent
of the JS.
Example in Jsfiddle.
Answer obtained in another question in the OS.
My iframe only has how I put the question.
– ChrisAdler
@Chrisadler Try to add the style I put in the answer.
– Oeslei
placed and still not showing the contents of Iframe (PDF)
– ChrisAdler
@Chrisadler Can you open the PDF directly in the browser? Paste the URL to the PDF into a new tab to check, as your browser may not be able to read.
– Oeslei
I got in the way and he opens the PDF
– ChrisAdler
He can’t show me the page.
– ChrisAdler