Commit 5d775f3e by Tu Nombre

Mejora Imprimir pdf

1 parent f009e76a
......@@ -28,6 +28,7 @@ function generarReporteTemplate (template) {
//REPORTE VIA CARBONE
var solicitud = {};
const patente = document.getElementById('patente_header');
message("Recuperando reporte "+ patente.value )
/////////////////////////ADAPTO_DATOS////////////////////////////
......@@ -107,10 +108,29 @@ function generarReporteTemplate (template) {
.then(data => {
var pdfUrl = data.full_url;
window.open(pdfUrl);
openPdfInPopup(pdfUrl);
document.getElementById("message").click();
})
.catch(error => {
console.error('Error:', error);
message('Error:'+ error);
});
}
function openPdfInPopup(url) {
// Especifica las características de la ventana emergente
const width = 800;
const height = 600;
const left = (screen.width - width) / 2;
const top = (screen.height - height) / 2;
// Abre la ventana emergente
window.open(url, '_blank', `width=${width},height=${height},top=${top},left=${left}`);
}
function message(msg) {
let m = document.getElementById("message");
m.style.display = "block";
m = document.getElementById("msg");
m.innerHTML = msg;
}
\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!