diff --git a/scripts/pdf.js b/scripts/pdf.js index ce03c65..6bf30f5 100644 --- a/scripts/pdf.js +++ b/scripts/pdf.js @@ -97,7 +97,11 @@ async function generate() { }); const page = await browser.newPage(); - await page.goto(`file://${inputPath}`, { waitUntil: 'networkidle0' }); + // Large illustrated books with many local images need generous timeouts + page.setDefaultNavigationTimeout(120_000); + page.setDefaultTimeout(120_000); + + await page.goto(`file://${inputPath}`, { waitUntil: 'networkidle0', timeout: 120_000 }); // Write to temp file first so Ghostscript can read it await page.pdf({ @@ -106,6 +110,7 @@ async function generate() { height: '8.75in', printBackground: true, margin: { top: 0, bottom: 0, left: 0, right: 0 }, + timeout: 120_000, }); await browser.close();