2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00

Default PDF Settings (#105)

* Fix values not updating in single doctypes

* Add print settings and comment isNew function

* Add print settings

* add no margin comment
This commit is contained in:
Anto Christopher 2019-01-12 16:12:30 +05:30 committed by Faris Ansari
parent 7a0356f414
commit 8bdce07a00
2 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,11 @@ async function getPDFForElectron(doctype, name, destination, htmlContent) {
const printPromise = new Promise(resolve => { const printPromise = new Promise(resolve => {
printWindow.webContents.on('did-finish-load', () => { printWindow.webContents.on('did-finish-load', () => {
printWindow.webContents.printToPDF({}, (error, data) => { printWindow.webContents.printToPDF({
marginsType: 1, // no margin
pageSize: 'A4',
printBackground: true
}, (error, data) => {
if (error) throw error if (error) throw error
printWindow.close(); printWindow.close();
fs.writeFile(filepath, data, (error) => { fs.writeFile(filepath, data, (error) => {

Binary file not shown.