Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolves #633 Introduce PUPPETEER_PRINT_TIMEOUT for puppeteer pdf rendering #632

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@ async function convert (processor, inputFile, options, timings, watch, preview)
}
try {
const page = await browserInstance.goto(`file://${tempFile}`, preview)
const puppeteerDefaultTimeout = process.env.PUPPETEER_DEFAULT_TIMEOUT
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be taken from browser instance but in terms of dependency reduction this might be better

const printTimeout = process.env.PUPPETEER_PRINT_TIMEOUT || puppeteerDefaultTimeout || 30000

if (!preview) {
const pdfOptions = {
printBackground: true,
preferCSSPageSize: true
preferCSSPageSize: true,
timeout: printTimeout
}
const pdfWidth = doc.getAttributes()['pdf-width']
if (pdfWidth) {
Expand Down