当前页面位置: » 丰搜网 » 文档中心 » 详细内容
asp开发必备:web打印代码大全
asp开发必备:web打印代码大全这篇文章主要介绍了如何使用asp控制web的各种打印效果,它能够控制纵打、横打和页面边距等。
1、控制"纵打"、 "横打"和"页面的边距"。
(1)
| <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> |
(2)
| <script language="javascript"> function printsetup(){ // 打印页面设置 wb.execwb(8,1); } function printpreview(){ // 打印页面预览 wb.execwb(7,1); } function printit() { if (confirm('确定打印吗?')) { wb.execwb(6,6) } } </script> </head> <body> |