In Web projects often use the print function, I am now using ScriptX, the basic function is free (advanced features surcharge)
is embedded in a Web page:
<Object the above mentioned id = "Factory's" VIEWASTEXT style = "Run the display: none" classid = "clsid: 1663ed61-23eb-11d2-b92f -008048fdd814" codebase = "hppt: //url/smsx.cab#Version=6,4,438,06"> </ object>
Note here some common javascript function control:
<
Script the defer
>
// ------------------- basic functions, free use ------------------- ---- factory.printing.header = "" ; // header factory.printing.footer = "" ; // footer factory.printing.SetMarginMeasure ( 1 ); // margin units, 1 mm, 2 inches to // margin settings, note that most printers can not print margins to zero, that is a minimum margins, are usually more than 6 mm // set time to time if margins set to zero, automatically adjusted to its minimum margin factory.printing.leftMargin = . 7 ; // left margin factory.printing.topMargin = . 7 ; // top margin
factory.printing.rightMargin = . 7 ; // right margin factory.printing.bottomMargin = . 7 ; // bottom margin factory.printing.portrait = to true ; // if portrait, landscape orientation is to false // ------ --------------Advanced Features---------------------------------- ----------- factory.printing.printer = "EPSON LQ-1600KIII"; // the specified printer using // factory.printing.printer = "\\ HPLaserJ \\\\ Cosa-Data" ; // such as a network printer, you need to escape the character factory.printing.paperSize = " A4 " ; // specify the paper used factory.printing.paperSource = "
Feed Manual " ; // feed mode, here is the manual feed factory.printing.copies = 1 ; // print copies factory.printing.printBackground = false ; // whether to print background images factory.printing.SetPageRange ( false , 1 , 3 ); // print pages 1 to 3 // ----- common function ------------- ------------------- factory.printing.Print ( to false ); // no confirmation printing, the time required for confirmation before printing to true // factory.printing.Print (to false , pageFrame); pageFrame Iframe or frame frame name is only print frame content factory.printing.PrintSetup ();
// print settings factory.printing.Preview (); // Print Preview factory.printing.WaitForSpoolingComplete (); // Wait for a complete print job into print spooler, very useful when continuous printing without confirming factory.printing.EnumPrinters (index); // for all printers installed enumerate, select a printer for generating a mainly < / Script>
factory.printing.rightMargin = . 7 ; // right margin factory.printing.bottomMargin = . 7 ; // bottom margin factory.printing.portrait = to true ; // if portrait, landscape orientation is to false // ------ --------------Advanced Features---------------------------------- ----------- factory.printing.printer = "EPSON LQ-1600KIII"; // the specified printer using // factory.printing.printer = "\\ HPLaserJ \\\\ Cosa-Data" ; // such as a network printer, you need to escape the character factory.printing.paperSize = " A4 " ; // specify the paper used factory.printing.paperSource = "
Feed Manual " ; // feed mode, here is the manual feed factory.printing.copies = 1 ; // print copies factory.printing.printBackground = false ; // whether to print background images factory.printing.SetPageRange ( false , 1 , 3 ); // print pages 1 to 3 // ----- common function ------------- ------------------- factory.printing.Print ( to false ); // no confirmation printing, the time required for confirmation before printing to true // factory.printing.Print (to false , pageFrame); pageFrame Iframe or frame frame name is only print frame content factory.printing.PrintSetup ();
// print settings factory.printing.Preview (); // Print Preview factory.printing.WaitForSpoolingComplete (); // Wait for a complete print job into print spooler, very useful when continuous printing without confirming factory.printing.EnumPrinters (index); // for all printers installed enumerate, select a printer for generating a mainly < / Script>
Reproduced in: https: //www.cnblogs.com/baoposhou/archive/2009/08/30/1556845.html