2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix: Set printPath using app.getAppPath()

This commit is contained in:
Faris Ansari 2019-12-05 02:33:52 +05:30
parent 8f02928cee
commit d027871707

View File

@ -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);