From 4ddbab45eaaf0aa17895469a6d28120d5ae5063a Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 9 Sep 2024 13:26:34 -0400 Subject: [PATCH] ? --- mccs-it/thermal/modules/Thermal.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/mccs-it/thermal/modules/Thermal.js b/mccs-it/thermal/modules/Thermal.js index e7235db..ffd9e2c 100644 --- a/mccs-it/thermal/modules/Thermal.js +++ b/mccs-it/thermal/modules/Thermal.js @@ -49,20 +49,11 @@ module.exports = { // Handle error if the printing process fails printer.on('error', (err) => { console.error('Failed to start printing process:', err); - res.status(500).send('Failed to start printing process'); }); // Pipe the PDF data to the printer printer.stdin.write(pdfData); - - // Handle the process exit event - printer.on('close', (code) => { - if (code === 0) { - res.send('PDF sent to printer successfully.'); - } else { - res.status(500).send('Failed to print PDF'); - } - }); + printer.stdin.end(); }); // Add content (image, text) to the PDF