web| Printing
Usually in the Web printing need scriptx.cab, here is the same, so the principle is the same, here will be detailed, how to control the printing problem.
There are 2 required files for printing:
1: Configuration file: Setting.js
2: Display files: print.js
Setting.js is as follows:
document.write ("<object id=\" factory\ "style=\" display:none\ "Viewastext classid=\" clsid : 1663ed61-23eb-11d2-b92f-008048fdd814\ "codebase=\" images/events/scriptx.cab#version=5,60,0,360\ "></ Object> ");
function Printers () {
Agree = confirm (' OK print? ');
if (agree) {
if (agree)
{
noprinter.style.visibility= ' hidden ';
Factory.printing.Print ();}
else noprinter.style.visibility= ' visible ';
}
}
Factory.printing.header = ""
Factory.printing.footer = ""
Factory.printing.leftMargin = 0.75
Factory.printing.topMargin = 0.75
Factory.printing.rightMargin = 0.75
Factory.printing.bottomMargin = 0.75
The file print.js appears as follows:
document.write (' <style media= ' print ' > @media print {. Noprint{display:none}}} </ Style> '); The
/////////////////////////////////~~ controls the style of not displaying buttons when printing, and you only need to reference the style where the page does not need to be printed
document.write (' <div id=noprinter name=noprinter align=right style= ' visibility:visible ' class= ' noprint ' >< br> ');
document.write (' <input type=button Class=button value= off name= "Bfq" id= "Bfq" onclick=\ "javascript\: Window.close ()/">");
document.write (' <input type= ' button "value=" Print Setup "onclick=\" Factory.printing.PageSetup () \ ">");
document.write (' <input type= "button" value= "Print Preview" onclick=\ "Factory.printing.Preview () \" > ");
document.write (' <input type=button name=button3 value= ' print ' > </div> ');
When using the print function, just include the file 2 files in the page where the Print button is placed, the code is as follows:
<script src= ". /inc/print/printer.js "></script>
<script src= ". /inc/print/printers.js "></script>