使用img标签替换对象标签UI变空白
问题描述:
我使用IDR工具(https://www.idrsolutions.com/online-pdf-to-html5-converter)将PDF文件转换为HTML5。它具有呈现svg文件的对象标签。如SVG not showing in object tag after publishing to web所述,我在应用程序的web.config文件或IIS服务器中添加了'.svg'mime类型。它仍然没有工作。我试图用img
标记和数据属性替换object
标记与src
属性。然后它导致空的UI页面。此外,我尝试使用iframe
标签,但会导致UI失真。有没有其他方法可以解决这个问题?使用img标签替换对象标签UI变空白
的代码行是如下:
<div id="pg1" style="-webkit-user-select: none;"><object width="935" height="1210" data="1/1.svg" type="image/svg+xml" id="pdf1" style="width:935px; height:1210px; background-color:white; -moz-transform:scale(1); z-index: 0;"></object></div>
答
如从https://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#SVG_in_HTML称为我在我的代码使用<embed>
标签。它工作正常。