Add Math.ceil to pageSize.height and pageSize.width to printToPDF() options to prevent error on display.
This commit is contained in:
parent
a748199833
commit
fa2bfd3ff5
1 changed files with 2 additions and 2 deletions
|
@ -198,8 +198,8 @@ WebContents.prototype.printToPDF = function (options, callback) {
|
||||||
printingSetting.mediaSize = {
|
printingSetting.mediaSize = {
|
||||||
name: 'CUSTOM',
|
name: 'CUSTOM',
|
||||||
custom_display_name: 'Custom',
|
custom_display_name: 'Custom',
|
||||||
height_microns: pageSize.height,
|
height_microns: Math.ceil(pageSize.height),
|
||||||
width_microns: pageSize.width
|
width_microns: Math.ceil(pageSize.width)
|
||||||
}
|
}
|
||||||
} else if (PDFPageSizes[pageSize]) {
|
} else if (PDFPageSizes[pageSize]) {
|
||||||
printingSetting.mediaSize = PDFPageSizes[pageSize]
|
printingSetting.mediaSize = PDFPageSizes[pageSize]
|
||||||
|
|
Loading…
Reference in a new issue