From 708aa3418180bb96af9507e6d93201197de59250 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 13 Sep 2024 09:38:22 -0400 Subject: [PATCH] ! --- mccs-it/thermal/app.js | 8 ++++---- mccs-it/thermal/modules/Thermal.js | 28 ++++++++++++---------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/mccs-it/thermal/app.js b/mccs-it/thermal/app.js index 1dc1151..1beb1c3 100644 --- a/mccs-it/thermal/app.js +++ b/mccs-it/thermal/app.js @@ -43,10 +43,10 @@ app.post('/print-temp-pw', async (req, res) => { } // Generate the information string - const infoString = Thermal.generateInfo.tempPassword(password); + const infoArray = Thermal.generateInfo.tempPassword(password); // Generate the PDF, saved to disk - Thermal.generatePdf(infoString).catch(e => { + Thermal.generatePdf(infoArray).catch(e => { console.error(e); res.status(500).json({ message: 'Error writing PDF file', error: err.message }); }); @@ -60,10 +60,10 @@ app.post('/print-temp-pw', async (req, res) => { app.post('/print-mcc', async (req, res) => { try { // Generate the information string - const infoString = Thermal.generateInfo.maineCC(); + const infoArray = Thermal.generateInfo.maineCC(); // Generate the PDF, saved to disk - Thermal.generatePdf(infoString).catch(e => { + Thermal.generatePdf(infoArray).catch(e => { console.error(e); res.status(500).json({ message: 'Error writing PDF file', error: e.message }); }); diff --git a/mccs-it/thermal/modules/Thermal.js b/mccs-it/thermal/modules/Thermal.js index 6217c78..7760af2 100644 --- a/mccs-it/thermal/modules/Thermal.js +++ b/mccs-it/thermal/modules/Thermal.js @@ -34,26 +34,22 @@ module.exports = { }, maineCC() { // Create the output text - const infoArray = [ - 'Kennebec Valley Community College is migrating email domains from @kvcc.me.edu to @mainecc.edu.\n', - `For support with this transition, please contact:\n${mccContractor.name}`, - `${mccContractor.phone}`, - `${mccContractor.email}`, - `${mccContractor.site}\n`, - receiptFooter + return [ + { font: 'public/Outfit-Regular.ttf', text: 'Kennebec Valley Community College is migrating email domains from @kvcc.me.edu to @mainecc.edu.\n' }, + { font: 'public/Outfit-Regular.ttf', text: `For support with this transition, please contact:\n${mccContractor.name}` }, + { font: 'public/Outfit-Regular.ttf', text: `${mccContractor.phone}` }, + { font: 'public/Outfit-Regular.ttf', text: `${mccContractor.email}` }, + { font: 'public/Outfit-Regular.ttf', text: `${mccContractor.site}\n` } ]; - return infoArray.join('\n'); }, tempPassword(password) { // Create the output text - const infoArray = [ - 'We have changed your password to a temporary password, shown below. Next time you log into Microsoft you will be prompted to change your password.\n', - 'Temporary Password:', - `${password}\n`, - 'Password requirements:\n8+ characters\n1+ Uppercase\n1+ Lowercase\n1+ Special (!/_=.,?)\n', - receiptFooter - ]; - return infoArray.join('\n'); + return [ + { font: 'public/Outfit-Regular.ttf', text: 'We have changed your password to a temporary password, shown below. Next time you log into Microsoft you will be prompted to change your password.\n' }, + { font: 'public/Outfit-Regular.ttf', text: 'Temporary Password:' }, + { font: 'public/RobotoMono-SemiBold.ttf', text: `${password}\n` }, + { font: 'public/Outfit-Regular.ttf', text: 'Password requirements:\n8+ characters\n1+ Uppercase\n1+ Lowercase\n1+ Special (!/_=.,?)\n' } + ] } }, generatePdf(infoArray) {