我已经在iframe显示了一个pdf,这是在aspx页面。我正在开发IE6浏览器。我使用以下html和javascript代码。
<iframe id = "frame_singleCheque" src = "../pdf/SingleCheque.pdf" runat = "server" style ="height:400px; width: 750px; overflow:scroll;" />
function printDoc()
{
window.frames['ctl00_contPlcHdrMasterHolder_frame_singleCheque'].focus();
window.frames['ctl00_contPlcHdrMasterHolder_frame_singleCheque'].print();
}
<input type="button" id = "btnCPrint" value = "Print" onclick="javascript:printDoc()" />如果按下“打印”按钮,就会显示“打印”对话框。但是每当我按下“打印”按钮,它就不会打印任何东西。它不会将事件打印为空白页。我该怎么打印?
发布于 2011-08-20 07:07:44
试试这个:
function printDoc() {
document.getElementById('frame_singleCheque').focus();
document.getElementById('frame_singleCheque').contentWindow.print();
}编辑:也可以查看this。
https://stackoverflow.com/questions/7130299
复制相似问题