Skip to content

Instantly share code, notes, and snippets.

@elecyb
Created December 13, 2018 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elecyb/aed8acfbacf7acd37177736e21cee62e to your computer and use it in GitHub Desktop.
Save elecyb/aed8acfbacf7acd37177736e21cee62e to your computer and use it in GitHub Desktop.
Solucion para la impresion de NE desde el chrome
diff --git a/Default.html b/Default.html
index b1a9003..1b486f6 100644
--- a/Default.html
+++ b/Default.html
@@ -31,14 +31,20 @@
// ventimp.close();
//}
function imprimirDiv(nombre) {
+ var altoVentana = 1;
+ var anchoVentana = 1;
if (window.ActiveXObject || ("ActiveXObject" in window)) {
var ficha = document.getElementById(nombre);
}
else {
var ficha = $('#' + nombre + '');
+ if (window.chrome) {
+ altoVentana = 800;
+ anchoVentana = 1000;
+ }
}
- var ventimp = window.open(' ', 'popimpr', "width=1,height=1,top=1,location=no,status=no,menubar=no,left=0,top=100,screenX=0,screenY=0,copyhistory=no");
- ventimp.document.write('<link rel="stylesheet" href="estilos/EstilosWebNoHttps.css" />')
+ var ventimp = window.open(' ', 'popimpr', "width=" + anchoVentana + ",height=" + altoVentana + ",top=1,location=no,status=no,menubar=no,left=0,top=100,screenX=0,screenY=0,copyhistory=no");
+ //ventimp.document.write('<link rel="stylesheet" href="estilos/EstilosWebNoHttps.css" />')
ventimp.document.write('<link rel="stylesheet" href="estilos/EstilosWebNoHttps-imprimir.css" media="print" />')
if (window.ActiveXObject || ("ActiveXObject" in window)) {
ventimp.document.write(ficha.innerHTML);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment