Buenas ,trato de imprimir un div que contiene un codigo de barra que se genera en javascript, se presenta en pantalla, pero cuando hago imprimir no lo imprime
una ayudita, please
aqui el codigo
<html>
<head>
<link rel="StyleSheet" href="barcode.css" type="text/css" />
<script src="barcode.js"></script>
<script type="text/javascript">
function encode()
{
var strValue = document.getElementById("barcode_input").value;
var strBarcodeHTML = code128(strValue);
document.getElementById("barcode").innerHTML = strBarcodeHTML;
}
function imprimir(idDiv)
{
var w = 600;
var h = 400;
var l = (window.screen.availWidth - w)/2;
var t = (window.screen.availHeight - h)/2;
var sOption="toolbar=no,location=no,directories=no,men ubar=no,scrollbars=yes,width=" + w + ",height=" + h + ",left=" + l + ",top=" + t;
// Get the HTML content of the div
var sDivText = window.document.getElementById(idDiv).innerHTML;
// Open a new window
var objWindow = window.open("", "Print", sOption);
// Write the div element to the window
objWindow.document.write(sDivText);
objWindow.document.close();
// Print the window
objWindow.print();
// Close the window
objWindow.close();
}
</script>
</head>
<div class="barcode128h" id="barcode"></div>
<br /><br />
<input style="margin-left:45px" type="text" id="barcode_input"></input>
<input type="button" value="Encode" onclick="encode()"/>
<div>
<button onclick="imprimir('barcode');">dele....</button>
<br />
imprimir bar code
<br />
<br />
</div>
</html>
gracias