Skip to content

Commit 503f90a

Browse files
committed
Now setting max page width and height. This allows large pages larger than the monitor to be captured.
1 parent 8b5a4b3 commit 503f90a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capture-template",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "This library is responsible for expanding a template web page and then capturing it PNG or PDF.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

src/web-page-renderer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ export class WebPageRenderer implements IWebPageRenderer {
7373
const nightmareOptions: any = {
7474
show: false,
7575
frame: false,
76+
maxHeight: 1000000,
77+
maxWidth: 1000000,
7678
};
7779

7880
if (this.electronPath) {
@@ -150,9 +152,9 @@ export class WebPageRenderer implements IWebPageRenderer {
150152
this.nightmare.goto(webPageUrl);
151153
this.nightmare.wait(options.waitSelector);
152154
await this.nightmare.evaluate(
153-
(catureSelector: string) => {
155+
(captureSelector: string) => {
154156
const body = document.querySelector('body');
155-
const element = document.querySelector(catureSelector);
157+
const element = document.querySelector(captureSelector);
156158
const rect = element.getBoundingClientRect();
157159
return {
158160
bodyWidth: body.scrollWidth,

0 commit comments

Comments
 (0)