Add Math.ceil to pageSize.height and pageSize.width to printToPDF() options to prevent error on display.

This commit is contained in:
Darrell Ulm 2017-05-06 19:19:31 -04:00
parent a748199833
commit fa2bfd3ff5

View file

@ -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]