diff --git a/mccs-it/thermal/modules/Thermal.js b/mccs-it/thermal/modules/Thermal.js index 10bf80f..3ee5062 100644 --- a/mccs-it/thermal/modules/Thermal.js +++ b/mccs-it/thermal/modules/Thermal.js @@ -23,16 +23,15 @@ module.exports = { credentials(username, studentId) { // Create the output text const infoArray = [ - `Username: ${username}`, - '', - 'Email:', - `${username}@kvcc.me.edu`, - '', - `Student ID: ${studentId}`, - '', - 'Note: the MyKV Portal uses your username to sign in, not email.', - receiptFooter - ]; + { font: 'public/RobotoMono-Regular.ttf', text: `Username: ${username}` }, + { font: 'public/Outfit-Regular.ttf', text: '' }, + { font: 'public/Outfit-Regular.ttf', text: 'Email:' }, + { font: 'public/RobotoMono-Regular.ttf', text: `${username}@kvcc.me.edu` }, + { font: 'public/Outfit-Regular.ttf', text: '' }, + { font: 'public/RobotoMono-Regular.ttf', text: `Student ID: ${studentId}` }, + { font: 'public/Outfit-Regular.ttf', text: '' }, + { font: 'public/Outfit-Regular.ttf', text: 'Note: the MyKV Portal uses your username to sign in, not email.' }, + ] return infoArray.join('\n'); }, maineCC() { @@ -59,7 +58,7 @@ module.exports = { return infoArray.join('\n'); } }, - generatePdf(infoString) { + generatePdf(infoArray) { return new Promise((resolve, reject) => { // Define the path for the PDF file const pdfFilePath = path.join(__dirname, '../public/output.pdf'); @@ -91,10 +90,13 @@ module.exports = { doc.moveDown(); // Write the text from infoString - doc.fontSize(12) - doc.font('public/Outfit-Regular.ttf').text(infoString, { - align: 'left', - }); + doc.fontSize(12) + for (row of infoArray) { + doc.moveDown(); + doc.font(row.font).text(row.text, { + align: 'left', + }); + } // Finalize the PDF doc.end(); diff --git a/mccs-it/thermal/public/RobotoMono-Regular.ttf b/mccs-it/thermal/public/RobotoMono-Regular.ttf new file mode 100644 index 0000000..6df2b25 Binary files /dev/null and b/mccs-it/thermal/public/RobotoMono-Regular.ttf differ