2
0
mirror of https://github.com/frappe/books.git synced 2024-12-25 20:11:15 +00:00

Corrected path for print.html

This commit is contained in:
thefalconx33 2019-09-03 12:52:14 +05:30
parent ea2d0a8383
commit 2a1673dfe3

View File

@ -25,7 +25,16 @@ async function getPDFForElectron(doctype, name, destination, htmlContent) {
const { remote, shell } = require('electron');
const { BrowserWindow } = remote;
const html = htmlContent || (await getHTML(doctype, name));
const filepath = path.join(destination, name + '.pdf');
if (!destination) {
destination =
process.env.NODE_ENV === 'development'
? path.resolve('.')
: remote.getGlobal('documentsPath');
}
const filepath = path.resolve(
path.join(destination, '/frappe-accounting/' + name + '.pdf')
);
const fs = require('fs');
let printWindow = new BrowserWindow({
@ -33,6 +42,9 @@ async function getPDFForElectron(doctype, name, destination, htmlContent) {
height: 800,
show: false
});
const __static = remote.getGlobal('__static') || __static;
printWindow.loadURL(`file://${path.join(__static, 'print.html')}`);
printWindow.on('closed', () => {