From d027871707bc50a478952da556dc71767f74c6c4 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 5 Dec 2019 02:33:52 +0530 Subject: [PATCH] fix: Set printPath using app.getAppPath() --- server/pdf.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/pdf.js b/server/pdf.js index f25e6b04..b5f6bdfc 100644 --- a/server/pdf.js +++ b/server/pdf.js @@ -47,7 +47,14 @@ async function getPDFForElectron(doctype, name, destination, htmlContent) { if (process.env.NODE_ENV === 'development') { url = `http://localhost:${process.env.PORT}/static/print.html`; } else { - url = `file://${__dirname}/static/print.html`; + let printPath = path.join( + remote.app.getAppPath(), + 'dist', + 'electron', + 'static', + 'print.html' + ); + url = `file://${printPath}`; } printWindow.loadURL(url);