用程序怎么控制"纵打"、 横打”和“页面的边距”?

如题?
---------------------------------------------------------------

1、

 1<script defer="">   
 2function SetPrintSettings() {   
 3// -- advanced features   
 4factory.printing.SetMarginMeasure(2) // measure margins in inches   
 5factory.SetPageRange(false, 1, 3) // need pages from 1 to 3   
 6factory.printing.printer = "HP DeskJet 870C"   
 7factory.printing.copies = 2   
 8factory.printing.collate = true   
 9factory.printing.paperSize = "A4"   
10factory.printing.paperSource = "Manual feed"   
11  
12// -- basic features   
13factory.printing.header = "This is MeadCo"   
14factory.printing.footer = "Advanced Printing by ScriptX"   
15factory.printing.portrait = false   
16factory.printing.leftMargin = 1.0   
17factory.printing.topMargin = 1.0   
18factory.printing.rightMargin = 1.0   
19factory.printing.bottomMargin = 1.0   
20}   
21</script>

2、

 1<script language="javascript">   
 2function printsetup(){   
 3// 打印页面设置   
 4wb.execwb(8,1);   
 5}   
 6function printpreview(){   
 7// 打印页面预览   
 8  
 9wb.execwb(7,1);   
10  
11  
12}   
13  
14function printit()   
15{   
16if (confirm('确定打印吗?')) {   
17wb.execwb(6,6)   
18}   
19}   
20</script>
 1<body>
 2<object classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="wb" name="wb" width="0"></object>
 3<input name="button_print" onclick="javascript:printit()" type="button" value="打印"/>
 4<input name="button_setup" onclick="javascript:printsetup();" type="button" value="打印页面设置"/>
 5<input name="button_show" onclick="javascript:printpreview();" type="button" value="打印预览"/>
 6<input name="button_fh" onclick="javascript:window.close();" type="button" value="关闭"/>   
 7  
 8\------------------------------------------------   
 9关于这个组件还有其他的用法,列举如下:   
10WebBrowser.ExecWB(1,1) 打开   
11Web.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口   
12Web.ExecWB(4,1) 保存网页   
13Web.ExecWB(6,1) 打印   
14Web.ExecWB(7,1) 打印预览   
15Web.ExecWB(8,1) 打印页面设置   
16Web.ExecWB(10,1) 查看页面属性   
17Web.ExecWB(15,1) 好像是撤销,有待确认   
18Web.ExecWB(17,1) 全选   
19Web.ExecWB(22,1) 刷新   
20Web.ExecWB(45,1) 关闭窗体无提示</body>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus