Merge pull request #9396 from drulm/printtopdf-custom-pagesize

Add Math.ceil to pageSize.height and pageSize.width to printToPDF() o…
This commit is contained in:
Cheng Zhao 2017-06-26 14:48:44 +09:00 committed by GitHub
commit 5fbcb6ef4e

View file

@ -198,8 +198,8 @@ WebContents.prototype.printToPDF = function (options, callback) {
printingSetting.mediaSize = {
name: 'CUSTOM',
custom_display_name: 'Custom',
height_microns: pageSize.height,
width_microns: pageSize.width
height_microns: Math.ceil(pageSize.height),
width_microns: Math.ceil(pageSize.width)
}
} else if (PDFPageSizes[pageSize]) {
printingSetting.mediaSize = PDFPageSizes[pageSize]