document.addEventListener("DOMContentLoaded", () => { // Input y botón para la sección FOLIOS const pdfInput = document.getElementById("pdfInput"); const mergeButton = document.getElementById("mergeButton"); // Input y botón para la sección UNIONES const pdfInputQR = document.getElementById("pdfInputQR"); const mergeButtonQR = document.getElementById("mergeButtonQR"); // Cuando se carga un archivo en el input de FOLIOS pdfInput.addEventListener("change", () => { if (pdfInput.files.length > 0) { mergeButton.click(); // Presiona el botón "Unir PDFs" } }); // Cuando se carga un archivo en el input de UNIONES pdfInputQR.addEventListener("change", () => { if (pdfInputQR.files.length > 0) { mergeButtonQR.click(); // Presiona el botón "Unir PDFs" } }); });