3
我想打印在Iframe中即时生成的PDF,但无法打印此PDF文件。这就是我现在所拥有的,我做错了什么?在Google Chrome上运行良好,但在IE 11上运行得不错。请帮助我完成这项工作。在此先感谢打印使用PDF生成PDF的iframe IE 11
这是HTML标记
<div id="contractFrameContainer" class="modal-body row">
<iframe id="contractIframe" name="contractIframe" width="100%" src=""></iframe>
</div>
这里是我的JavaScript在那里我分配与动态URL的iframme的src
(此URL生成PDF)
var url = currentUrl + '/contracts/createpdf?ProductId=' + Id + '&type='
+ Type + '&term=' + Term
+ '&deductible=' + Deductible
+ '&key=' + OrderNumber
+ '&financedAmount=' + financedAmount
+ '&downpayment=' + downpayment
+ '&apr=' + apr
+ '&tire=' + tireRotation
+ '&interval=' + interval
+ '&salesPrice=' + salesPrice
+ '&dealerCost=' + DealerCost
+ '&mileage=' + Mileage
+ '&serviceDate=' + serviceDate
+ '&penSurcharges=' + penSurcharges
+ '&price=' + Price;
var iframe = document.getElementById("contractIframe");
iframe.height = heightBody;
iframe.src = url;
而且终于在这里我试图打印
document.getElementById('contractIframe').focus();
document.getElementById('contractIframe').contentWindow.print();
在IE 11上,这给我发电子邮件RROR“无效调用对象”
我想这也没有成功:
window.frames["contractIframe"].focus();
window.frames["contractIframe"].print();
有什么解决办法吗? – SwR 2016-04-27 10:14:13
看看我的解决方案:) – martinezjc 2016-04-27 14:27:54