Skip to content

Commit 7b8471c

Browse files
authored
Merge pull request #73 from Baltazar5000/master
Auto height option
2 parents 0816413 + 6c22618 commit 7b8471c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Converter.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ class Converter
9494
delete options.pageWaitFor;
9595
}
9696

97+
if (options.hasOwnProperty('height')) {
98+
if(options.height === 'auto'){
99+
options.height = await page.evaluate(() => document.body.scrollHeight);
100+
}
101+
}
102+
97103
return this._getPdf(page, options)
98104
}
99105

0 commit comments

Comments
 (0)