嵌入在< object>中的PDF或<嵌入>标记不在IE 11中加载 [英] PDF Embedded in <object> or <embed> tag not loading in IE 11
问题描述
我必须创建一个我正在使用的图片滑块:
Galleriffic插件> http://www.twospy.com/galleriffic/ ,
in图像滑块以及图像,我必须为某些情况显示PDF。
为了表明这一点,我将< div> ; 在<
>中嵌入 PDF 与图像有关。
对于带有PDF的Slider,您可以在此处看到完整的代码: http://jsfiddle.net/Z99gr/2/
我试图用<对象>或< embed>
标记,它在Chrome和Firefox中运行良好。但不是在IE11中。
我无法理解缺少什么,因为我只用一个嵌入PDF的工具创建了一个小提琴,它的工作正常Chrome浏览器,Firefox和IE11。
请仔细研究这个问题,并尽快提出我对IE缺少的内容11。
谢谢!
我现在可以嵌入使用< iframe>
标记的PDF文件IE。 $ b < < code>< iframe> < object> 和< embed>
>,它现在可以与所有3种浏览器,Firefox,Chrome和IE兼容。
有两种在IE中嵌入PDF的方法。
第一种方式:直接在< iframe>
中调用PDF
以下是更新的代码:
< div id =pdf>
< p>您的网页浏览器似乎不支援iframe。< / p>
< / iframe>
< / div>
第二种方式:如果浏览器没有PDF阅读器,则可以调用HTML < iframe>
,其中包含< object>
标记。
下面是第二个选项的代码
< div id =pdf>
< p>您的网页浏览器似乎不支援iframe。< / p>
< / iframe>
< / div>
代码为 pdf.html
< body>
< object data =lorem.pdftype =application / pdf>
看起来您在此网页浏览器中没有Adobe Reader或PDF支持。 < a href =lorem.pdf>点击此处下载PDF< / a> ;.或< a href =http://get.adobe.com/reader/target =_ blank>点击此处安装Adobe Reader< / a>。< / p>
< embed src =lorem.pdftype =application / pdf/>
< / object>
< / body>
这对我有用!!!
这里是WORKING Fiddle: http://jsfiddle.net/stmjvz4f/
希望以后对其他人有所帮助!
I have to create an Image slider for which I am using:
"Galleriffic plugin > http://www.twospy.com/galleriffic/",
in the Image slider, along with images, I have to show PDFs for some cases.
And to show that, I am putting the <div>
which embeds PDF inside "<div class="caption">
" where you can show the description related to the image.
For the Slider with PDF, you can see the full code here: http://jsfiddle.net/Z99gr/2/
I am trying to embed the PDF using <object> or <embed>
tag, It works fine in Chrome and Firefox. BUT not in IE11.
I am not able to understand what is missing as I have create one more fiddle with just one div which embeds the PDF and its works fine in all three browser, Chrome, Firefox and IE11.
Please look into the issue and suggest ASAP what am I missing for IE 11.
Thanks!
I was now able to embed the PDF file IE using "<iframe>
" tag.
I replaced "<object>
" and "<embed>
" tag with <iframe>
and its working fine now with all 3 browsers, Firefox, Chrome and IE.
There are 2 ways of embedding PDF in IE.
1st way: Call PDF directly in <iframe>
Below is the updated code:
<div id="pdf">
<iframe src="https://www.adobe.com/products/pdfjobready/pdfs/pdftraag.pdf" style="width: 100%; height: 100%;" frameborder="0" scrolling="no">
<p>It appears your web browser doesn't support iframes.</p>
</iframe>
</div>
2nd way: if the browser doesn't have PDF reader the u can call an HTML page in <iframe>
which contains <object>
tag .
Below is the code for 2nd option
<div id="pdf">
<iframe src="pdf.html" style="width: 100%; height: 100%;" frameborder="0" scrolling="no">
<p>It appears your web browser doesn't support iframes.</p>
</iframe>
</div>
Code for "pdf.html"
<body>
<object data="lorem.pdf" type="application/pdf">
<p>It appears you don't have Adobe Reader or PDF support in this web browser. <a href="lorem.pdf">Click here to download the PDF</a>. Or <a href="http://get.adobe.com/reader/" target="_blank">click here to install Adobe Reader</a>.</p>
<embed src="lorem.pdf" type="application/pdf" />
</object>
</body>
This worked for me!!!
Here is the WORKING Fiddle : http://jsfiddle.net/stmjvz4f/
Hope it will be helpful for others in future!
这篇关于嵌入在< object>中的PDF或<嵌入>标记不在IE 11中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!