|
@@ -82,7 +82,7 @@ const defaultPrintingSetting = {
|
|
|
deviceName: 'Save as PDF',
|
|
|
generateDraftData: true,
|
|
|
fitToPageEnabled: false,
|
|
|
- scaleFactor: 1,
|
|
|
+ scaleFactor: 100,
|
|
|
dpiHorizontal: 72,
|
|
|
dpiVertical: 72,
|
|
|
rasterizePDF: false,
|
|
@@ -208,6 +208,12 @@ WebContents.prototype.printToPDF = function (options) {
|
|
|
if (options.landscape) {
|
|
|
printingSetting.landscape = options.landscape
|
|
|
}
|
|
|
+ if (options.fitToPageEnabled) {
|
|
|
+ printingSetting.fitToPageEnabled = options.fitToPageEnabled
|
|
|
+ }
|
|
|
+ if (options.scaleFactor) {
|
|
|
+ printingSetting.scaleFactor = options.scaleFactor
|
|
|
+ }
|
|
|
if (options.marginsType) {
|
|
|
printingSetting.marginsType = options.marginsType
|
|
|
}
|
|
@@ -242,7 +248,7 @@ WebContents.prototype.printToPDF = function (options) {
|
|
|
}
|
|
|
|
|
|
// Chromium expects this in a 0-100 range number, not as float
|
|
|
- printingSetting.scaleFactor *= 100
|
|
|
+ printingSetting.scaleFactor = Math.ceil(printingSetting.scaleFactor) % 100
|
|
|
if (features.isPrintingEnabled()) {
|
|
|
return this._printToPDF(printingSetting)
|
|
|
} else {
|