- 爱易网页
-
Java教程
- jsp打印的有关问题
日期:2014-05-18 浏览次数:20784 次
jsp打印的问题
我以前的做的打印用的是这样的代码:
<style type= "text/css ">
.pageEnd {page-break-after:always}
</style>
</head>
<script defer>
function SetPrintSettings() {
// -- advanced features
factory.printing.SetMarginMeasure(2) // measure margins in inches
factory.SetPageRange(false, 1, 3) // need pages from 1 to 3
factory.printing.printer = "HP DeskJet 870C "
factory.printing.copies = 2
factory.printing.collate = true
factory.printing.paperSize = "A4 "
factory.printing.paperSource = "Manual feed "
// -- basic features
factory.printing.header = "This is MeadCo "
factory.printing.footer = "Advanced Printing by ScriptX "
factory.printing.portrait = false
factory.printing.leftMargin = 1.0
factory.printing.topMargin = 1.0
factory.printing.rightMargin = 1.0
factory.printing.bottomMargin = 1.0
}
</script>
<script language= "javascript ">
function printsetup(){
// 打印页面设置
wb.execwb(8,1);
}
function printpreview(){
// 打印页面预览
wb.execwb(7,1);
}
function printit()
{
if (confirm( '确定打印吗? ')) {
wb.execwb(6,6)
}
}
</script>
<body>
<p>
<input type= "button " value= "打印本页 " onClick= "window.print() ">
<a href= "javascript:window.print() "> 打印本页 </a> </p>
<OBJECT classid= "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 "
height=0 id=wb name=wb width=0> </OBJECT>
<input type=button name=button_print value= "打印 " onclick= "javascript:printit() ">
<input type=button name=button_setup value= "打印页面设置 " onclick= "javascript:printsetup(); ">
<input type=button name=button_show value= "打印预览 " onclick= "javascript:printpreview(); ">
<input type=button name=button_fh value= "关闭 " onclick= "javascript:window.close(); ">
是可以打印的,运行正常。可是现在这些功能老是被浏览器阻止了,说是不安全的activex控件。我想请教一下这是我的浏览器的问题还是代码的问题呢?请高手指点一下,或者有更好的打印方法也行。
------解决方案--------------------
浏览器的安全级别设置
------解决方案--------------------