Skip to content

Commit

Permalink
chore: fix pageRanges param
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Apr 11, 2022
1 parent e380281 commit 7fdb8d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/browser/api/web-contents.ts
Expand Up @@ -302,7 +302,7 @@ WebContents.prototype.printToPDF = async function (options) {
}

if (options.preferCSSPageSize !== undefined) {
if (typeof options.preferCSSPageSize !== 'string') {
if (typeof options.preferCSSPageSize !== 'boolean') {
return Promise.reject(new Error('footerTemplate must be a String'));
}
printSettings.preferCSSPageSize = options.preferCSSPageSize;
Expand Down
5 changes: 1 addition & 4 deletions spec-main/api-web-contents-spec.ts
Expand Up @@ -1871,10 +1871,7 @@ describe('webContents module', () => {

it('respects custom settings', async () => {
const data = await w.webContents.printToPDF({
pageRanges: {
from: 0,
to: 2
},
pageRanges: '1-3',
landscape: true
});

Expand Down

0 comments on commit 7fdb8d2

Please sign in to comment.