Skip to content

Commit 77fe479

Browse files
committed
Try sleeping before generating the PDF
1 parent 0f15863 commit 77fe479

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pdf-export.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ const slidesPath = path.join(
88
path.dirname(import.meta.url),
99
"index.html?print-pdf"
1010
);
11-
console.log(`Navigating to ${slidesPath}`);
1211

12+
console.log(`Navigating to ${slidesPath}`);
1313
await page.goto(slidesPath);
1414

15-
console.log(`Generating PDF version of the slides for ${await page.title()}`);
15+
await new Promise((r) => setTimeout(r, 2000));
1616

17+
console.log(`Generating PDF version of the slides for ${await page.title()}`);
1718
await page.pdf({ path: "slides.pdf", format: "A4", timeout: 0 });
1819

1920
await browser.close();

0 commit comments

Comments
 (0)