ASP开发必备:WEB打印代码大全

控制"纵打"、"横打"和"页面的边距"。

<scriptdefer>
  functionSetPrintSettings(){
  //--advancedfeatures
  factory.printing.SetMarginMeasure(2)//measuremarginsininches
  factory.SetPageRange(false,1,3)//needpagesfrom1to3
  factory.printing.printer="HPDeskJet870C"
  factory.printing.copies=2
  factory.printing.collate=true
  factory.printing.paperSize="A4"
  factory.printing.paperSource="Manualfeed"

  //--basicfeatures
  factory.printing.header="ThisisMeadCo"
  factory.printing.footer="AdvancedPrintingbyScriptX"
  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>



<scriptlanguage="javascript">
  functionprintsetup(){
  //打印页面设置
  wb.execwb(8,1);
  }
  functionprintpreview(){
  //打印页面预览
  
  wb.execwb(7,1);
  
  
  }

  functionprintit()
  {
  if(confirm('确定打印吗?')){
  wb.execwb(6,6)
  }
  }
  </script>
  </head>
  <body>

你可能感兴趣的:(JavaScript,Web,asp)