Skip to content

Commit 6c22618

Browse files
author
German K
committed
Auto height option
1 parent 0816413 commit 6c22618

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)