【发布时间】:2017-12-10 14:21:31
【问题描述】:
这部分代码在 Chrome 中运行良好,但在 IE 和 Edge 中却不行。
HTML
<object id="pdfObject" ng-hide="$ctrl.item == false" data="{{content}}" type="application/pdf" style="height: 100%;width: 100%;padding-bottom: 40px;">
<embed id="pdfEmbed" ng-src="{{content}}" type="application/pdf" style="height: 100%;width: 100%;"/></object>
JS
var file = new Blob([this.item], { type: 'application/pdf' });
var fileURL = URL.createObjectURL(file);
$scope.content = $sce.trustAsResourceUrl(fileURL)
this.item 有来自 HTTP 调用的响应。
【问题讨论】:
-
“不起作用”.... 尝试关闭 IE 的 ActiveX 过滤。工具>ActiveX 过滤。设置 IE 以在开发工具控制台中记录被阻止的内容和安全消息...工具>Internet 选项>高级选项卡,选中“始终记录开发者控制台消息”。保存更改。 PDF 文档托管在 IE 中的 ActiveX 控件中... chrome 使用内置插件... 从 IE 使用工具>管理插件>显示所有插件以管理您的 PDF 查看器插件。
-
大声笑我不想要那种解决方案...
-
此问题还有其他解决方案吗?
标签: internet-explorer pdf blob embed microsoft-edge