Skip to content

Commit e6f4ad7

Browse files
committed
Removed print resizing
1 parent 1e29c19 commit e6f4ad7

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/commands/GeneratePDF.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,9 @@
11
import { IEvent } from "../IEvent";
22
import Command from "./Command";
33

4-
let document: any;
5-
6-
function getMaxPageSize() {
7-
return Array.from<any>(document.all).reduce((a, c) => Math.max(c.scrollHeight , a) , 0);
8-
}
9-
104
export default class GeneratePDF extends Command {
115
async render({ outputFile: path, page, output, pdf }: IEvent) {
126

13-
const height = await page.evaluate(getMaxPageSize);
14-
15-
const {
16-
width,
17-
isMobile,
18-
deviceScaleFactor,
19-
hasTouch,
20-
isLandscape
21-
} = page.viewport();
22-
23-
await page.setViewport({
24-
width,
25-
height,
26-
isMobile,
27-
deviceScaleFactor,
28-
hasTouch,
29-
isLandscape
30-
});
31-
32-
await page.emulateMediaType("screen");
33-
347
const pf = typeof pdf === "object"
358
? { ... pdf, path}
369
: { path };

0 commit comments

Comments
 (0)