From 9bda14b4018bacd7e465585a810d7136d748cdc7 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 19 Dec 2022 14:36:51 +0100 Subject: [PATCH] refs #4550 Bugs solved --- print-server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/print-server.js b/print-server.js index 0ba94bf..f6a4416 100644 --- a/print-server.js +++ b/print-server.js @@ -172,14 +172,13 @@ class PrintServer { fs.mkdirSync(tmpPath) const tmpFilePath = path.join(tmpPath, `${Math.random().toString(36).substring(7)}.pdf`); await fs.writeFile(tmpFilePath, pdfData, 'binary'); - const printCommand = `p -d "${printer}" "${tmpFilePath}"`; // Print PDF try { - await pExec(printCommand); + await pExec(`lp -d "${printer}" "${tmpFilePath}"`); } catch(err) { await fs.unlink(tmpFilePath); - throw new Error(`Print error: '${printCommand}': ${err.message}`); + throw new Error(`Print error: ${err.message}`); } await conn.query(updateQuery, ['printed', null, jobId]);