Hola tengo una instruccion para imprimir en java script... pero necesito agregarla a varias paginas... asi que deseo ver si alguien conoce la manera de agragar la instruccion javascript en una pagina css.... gracias... les pongo el codigo de la insctruccion y el boton de impresion ...
<object id=factory viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,1,432,1">
</object>
<script defer>
function doPrint() {
//document.all.item("noprint").style.display="none"
//document.all.item("printtitle").style.display=""
// -- advanced features
// factory.printing.SetMarginMeasure(2); // measure margins in inches
// factory.printing.printer = "HP DeskJet 870C";
// factory.printing.paperSize = "A4";
// factory.printing.paperSource = "Manual feed";
// factory.printing.collate = true;
// factory.printing.copies = 2;
// factory.printing.SetPageRange(false, 1, 3); // need pages from 1 to 3
// -- basic features
factory.printing.header = "";
factory.printing.footer = "";
factory.printing.portrait = true;
factory.printing.leftMargin = 1.0;
factory.printing.topMargin = 1.0;
factory.printing.rightMargin = 1.0;
factory.printing.bottomMargin = 1.0;
factory.printing.Print(false)
//document.all.item("noprint").style.display=""
//document.all.item("printtitle").style.display="non e"
}
</script>
y aki el boton de impresion....
<div id=noprint align=right>
<p>
<INPUT class="nover" id="cmdPrint" name="cmdPrint" type="button" value="Imprimir" onclick="doPrint()">
</p></div>
<div id=printtitle style="display:none">
</div>