From 12fd3ed9f3911a985b8d57eb1c9dfc7b30b0a461 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 9 Sep 2024 13:41:14 -0400 Subject: [PATCH] ? --- mccs-it/thermal/modules/Thermal.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mccs-it/thermal/modules/Thermal.js b/mccs-it/thermal/modules/Thermal.js index 0b5c0cb..c3c701a 100644 --- a/mccs-it/thermal/modules/Thermal.js +++ b/mccs-it/thermal/modules/Thermal.js @@ -27,7 +27,7 @@ module.exports = { // Create a new PDF document const doc = new PDFDocument({ - size: [204, 1000], + size: [204, 400], margin: 5 }); @@ -69,15 +69,7 @@ module.exports = { // Handle the process exit event printer.on('close', (code) => { if (code === 0) { - // Delete the file after printing to clean up - fs.unlink(pdfFilePath, (err) => { - if (err) { - console.error('Error deleting file:', err); - res.status(500).json({ message: 'Failed to clean up after printing', error: err.message }); - return; - } - res.send('PDF sent to printer successfully.'); - }); + res.send('PDF sent to printer successfully.'); } else { res.status(500).json({ message: 'Failed to print PDF' }); }