From fa2bfd3ff55dd1ad39e0669048a8dfa58285dabf Mon Sep 17 00:00:00 2001 From: Darrell Ulm Date: Sat, 6 May 2017 19:19:31 -0400 Subject: [PATCH] Add Math.ceil to pageSize.height and pageSize.width to printToPDF() options to prevent error on display. --- lib/browser/api/web-contents.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index c49c1be8ba..1ea5b15599 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -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]