mirror of
https://github.com/frappe/books.git
synced 2024-12-27 04:32:41 +00:00
fix: Set printPath using app.getAppPath()
This commit is contained in:
parent
8f02928cee
commit
d027871707
@ -47,7 +47,14 @@ async function getPDFForElectron(doctype, name, destination, htmlContent) {
|
|||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
url = `http://localhost:${process.env.PORT}/static/print.html`;
|
url = `http://localhost:${process.env.PORT}/static/print.html`;
|
||||||
} else {
|
} 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);
|
printWindow.loadURL(url);
|
||||||
|
Loading…
Reference in New Issue
Block a user