From f636e6c194285e305533472984b9bb9ff1cf8021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20=C5=A0t=C3=A1gl?= Date: Mon, 14 Feb 2022 17:51:43 +0100 Subject: [PATCH] Up docs (#1910) * Up docs This gave me a real headache. On some html documents / pages pdf would be generated prematurely with no text. Relates to https://github.com/puppeteer/puppeteer/issues/422 * Update README.md * Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a37841bb1..3d0030d21 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,8 @@ using var browserFetcher = new BrowserFetcher(); await browserFetcher.DownloadAsync(); await using var browser = await Puppeteer.LaunchAsync(new LaunchOptions {Headless = true}); await using var page = await browser.NewPageAsync(); -await page.GoToAsync("http://www.google.com"); +await page.GoToAsync("http://www.google.com"); // In case of fonts being loaded from a CDN, use WaitUntilNavigation.Networkidle0 as a second param. +await page.EvaluateExpressionHandleAsync("document.fonts.ready"); // Wait for fonts to be loaded. Omitting this might result in no text rendered in pdf. await page.PdfAsync(outputFile); ``` snippet source | anchor