Change save dir of generated pdfs

This commit is contained in:
Skylar Grant 2024-09-12 15:32:29 -04:00
parent 25dbbfc088
commit 5f1e3b1215

View File

@ -62,7 +62,7 @@ module.exports = {
generatePdf(infoString) { generatePdf(infoString) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// Define the path for the PDF file // Define the path for the PDF file
const pdfFilePath = path.join(__dirname, 'output.pdf'); const pdfFilePath = path.join(__dirname, '../public/output.pdf');
// Create a new PDF document // Create a new PDF document
const doc = new PDFDocument({ const doc = new PDFDocument({
@ -112,7 +112,7 @@ module.exports = {
print() { print() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// Define the path for the PDF file // Define the path for the PDF file
const pdfFilePath = path.join(__dirname, 'output.pdf'); const pdfFilePath = path.join(__dirname, '../public/output.pdf');
// Start the print command // Start the print command
const printer = spawn('lp', ['-d', 'ITThermal', pdfFilePath]); const printer = spawn('lp', ['-d', 'ITThermal', pdfFilePath]);