Skip to content

Commit

Permalink
Merge pull request #21 from Gavant/pass-options-to-puppeteer
Browse files Browse the repository at this point in the history
Pass options to puppeteer
  • Loading branch information
bakerac4 authored Jun 8, 2023
2 parents 355f743 + 7b689f4 commit d548ec9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"prepare": "yarn build",
"cli": "ts-node src/cli.ts",
"test": "tsc -p tsconfig.json && qunit dist/tests/unit/requests/**/*.js && qunit dist/tests/unit/services/pdf-generation.js",
"test-all": "tsc -p tsconfig.json && qunit dist/tests/**/*.js",
"lint": "eslint src/ --ext .js,.ts",
"build": "tsc -p tsconfig-build.json",
"clean": "rm -rf dist build",
Expand Down
3 changes: 2 additions & 1 deletion src/services/pdf-generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default class PdfGenerationService {
}
console.log(pdfGenerationRequest);
await page.goto(pdfGenerationRequest.url, {
waitUntil: 'networkidle0'
waitUntil: 'networkidle0',
...pdfGenerationRequest.pdfOptions
});
console.log(`Puppeteer visited page located at ${pdfGenerationRequest.url}`);
const options = { ...htmlToPdfPrintOptions, ...pdfGenerationRequest.pdfOptions };
Expand Down

0 comments on commit d548ec9

Please sign in to comment.