MeadCo's ScriptX Printing Programming Manual 上面什么都有的嘛。<body>
<object id=factory style="display:none"
  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="ScriptX.cab#Version=6,1,429,14">
</object>
<script>
function preview() {
factory.printing.header = "This is MeadCo"
factory.printing.footer = "Printing by ScriptX 5.x"
factory.printing.portrait = false
factory.printing.leftMargin = 1.0
factory.printing.topMargin = 1.0
factory.printing.rightMargin = 1.0
factory.printing.bottomMargin = 1.0
factory.printing.Preview()
}
function printWindow() {
factory.printing.header = "This is MeadCo"
factory.printing.footer = "Printing by ScriptX 5.x"
factory.printing.portrait = false
factory.printing.leftMargin = 1.0
factory.printing.topMargin = 1.0
factory.printing.rightMargin = 1.0
factory.printing.bottomMargin = 1.0
factory.printing.Print(true, window)
}
</script>
<button onclick="preview()">preview</button>
<button onclick="printWindow()">printWindow</button></body>

解决方案 »

  1.   

    好像要用到smsx.cab。手册上说:Advanced functionality: smsx.cab
    smsx.cab contains both the ScriptX and the Security Manager?/SPAN> binaries required to publish fully-functional licensed content:<!-- MeadCo Security Manager -->
    <object viewastext style="display:none"
      classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
      codebase="smsx.cab#Version=6,1,428,11">
      <param name="GUID" value="{1FB3613D-2B04-11D4-A695-0000863B364E}">
      <param name="Path" value="sxlic.mlf">
      <param name="Revision" value="0">
    </object><!-- MeadCo ScriptX -->
    <object id=factory viewastext style="display:none"
    classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
      codebase="smsx.cab#Version=6,1,428,11">
    </object>
    NOTE: the {1FB3613D-2B04-11D4-A695-0000863B364E} value of the GUID parameter used above identifies the MeadCo evaluation license that authors may use to experiment with Advanced printing capabilities. The license validates local filesystem (file://) and local website (http://localhost/) content for evaluation purposes only on a single development computer.The evaluation license is periodic. It will expire in a few months and will be replaced by a new one with a different GUID, so any code depending on the evaluation license may suddenly stop working at any time.Registered customers are issued with an unique license identifier and a digitally signed sxlic.mlf license file. See the licensing?/SPAN> page for more details. Check out the sources of the Advanced and Techie printing examples for a complete illustration of how to use licensed ScriptX functionality. The following JScript code snippet shows how to modify printing settings so as to print to a specific printer:<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
    }function Print(frame) {
      factory.printing.Print(true, frame) // print with prompt
    }
    </script>
    A subtle JScript syntax issue may occur when setting a printer name that contains back slashes. Don't forget to double the slashes:factory.printing.printer = "\\\\FS-LYS-01\\HP5n-759" // print to \\FS-LYS-01\HP5n-759
      

  2.   

    smsx.cab好象用不了,我试了,说是这个组件没有出版许可,不能用!你再帮我看看吧!
      

  3.   

    required to publish fully-functional licensed content:需要全功能许可证?是要买的那个吧?没仔细研究过。你自己去好好看看嘛。