正在阅读:ASP开发必备:WEB打印代码大全ASP开发必备:WEB打印代码大全

2004-10-20 10:13 出处:PConline 作者:laojievip 责任编辑:linjixiong

  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> 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键
302 Found

302 Found


Powered by Tengine
tengine