diff --git a/src/commands/GeneratePDF.ts b/src/commands/GeneratePDF.ts index 7ab5044..7996d13 100644 --- a/src/commands/GeneratePDF.ts +++ b/src/commands/GeneratePDF.ts @@ -1,36 +1,9 @@ import { IEvent } from "../IEvent"; import Command from "./Command"; -let document: any; - -function getMaxPageSize() { - return Array.from(document.all).reduce((a, c) => Math.max(c.scrollHeight , a) , 0); -} - export default class GeneratePDF extends Command { async render({ outputFile: path, page, output, pdf }: IEvent) { - const height = await page.evaluate(getMaxPageSize); - - const { - width, - isMobile, - deviceScaleFactor, - hasTouch, - isLandscape - } = page.viewport(); - - await page.setViewport({ - width, - height, - isMobile, - deviceScaleFactor, - hasTouch, - isLandscape - }); - - await page.emulateMediaType("screen"); - const pf = typeof pdf === "object" ? { ... pdf, path} : { path };