From 9101f7f877978079d1a63601ef20d3f684f1774c Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 8 Jan 2026 12:37:48 -0500 Subject: [PATCH] Add an alert reminding user to set the scaling correctly when printing. --- src/assets/ITThermal.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/assets/ITThermal.js b/src/assets/ITThermal.js index d221aa2..59fd277 100644 --- a/src/assets/ITThermal.js +++ b/src/assets/ITThermal.js @@ -1,7 +1,7 @@ /* ITS Thermal Receipt Printer * Developed by Skylar Grant for MCCS ITS */ -const version = "1.2.6"; +const version = "1.2.7"; // ############################################################# // Variables // ############################################################# @@ -94,7 +94,6 @@ function tempPasswordHandler() { const lineArray = prepTempPassword(password, username); const bUrl = generateFile(lineArray, true, true); displayPdf(bUrl); - if (window.navigator.userAgent.includes('Firefox')) printPdf(); } function customNoteHandler() { @@ -109,7 +108,6 @@ function customNoteHandler() { const lineArray = prepCustomDetails(customNoteDetails); const bUrl = generateFile(lineArray, true, false); displayPdf(bUrl); - if (window.navigator.userAgent.includes('Firefox')) printPdf(); } function deviceTrackerHandler() { @@ -141,7 +139,6 @@ function deviceTrackerHandler() { const lineArray = prepDeviceTracker(dtticket, dtuser, dtservice, dtnotes); const bUrl = generateFile(lineArray, true, false); displayPdf(bUrl); - if (window.navigator.userAgent.includes('Firefox')) printPdf(); } /** @@ -283,6 +280,12 @@ function displayPdf(blobUrl) { const pdfViewerContainer = document.getElementById('pdfViewerContainer'); pdfViewer.src = blobUrl; pdfViewerContainer.style.display = 'block'; + // Check UserAgent if it contains FireFox we go ahead and send the print dialog + if (navigator.userAgent.includes('Firefox')) { + printPdf(); + } else { + alert('Make sure to select "Actual Size" or 100% in the print dialog for correct sizing.'); + } } function printPdf() {