- 在打印的页面运行,document.execCommand("Print"); 或 在要打印的页面参照下面的帖子中的,但问题也在当中:
/*******引用于http://community.csdn.net/Expert/TopicView3.asp?id=5091872***** 代码如下 在Windows 2000 + IE6,可以直接打印,但是在Windows XP + IE6就会出现打印机选择框,怎么能做到XP下直接打印? **/ - 页面加载控件:
<object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"></object>
控件使用教本:
<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 //方向,true
factory.printing.leftMargin = 1.0
factory.printing.topMargin = 1.0
factory.printing.rightMargin = 1.0
factory.printing.bottomMargin = 1.0
factory.printing.Print(false) //直接打印,true ,好像不起作用,总是弹出选择打印机窗口
factory.printing.PageSetup() //打印设置
factory.printing.Preview() //打印预览
}
</script>
web打印,不弹出对话框
最新推荐文章于 2024-07-15 14:15:20 发布