This commit is contained in:
Skylar Grant 2024-09-12 13:45:18 -04:00
parent 665f1fe563
commit 8581027340

View File

@ -21,9 +21,9 @@ app.post('/print-credentials', async (req, res) => {
const infoString = Thermal.generateInfo.credentials(username, studentId); const infoString = Thermal.generateInfo.credentials(username, studentId);
// Generate the PDF, saved to disk // Generate the PDF, saved to disk
Thermal.generatePdf(infoString).then(res => { Thermal.generatePdf(infoString).then(resolve => {
// Print the document // Print the document
Thermal.print().then(res => { Thermal.print().then(resolve => {
res.send('PDF sent to printer successfully.'); res.send('PDF sent to printer successfully.');
}).catch(e => { }).catch(e => {
console.error('Failed to start printing process:', e); console.error('Failed to start printing process:', e);