Skip to content

External imported fonts - randomly not rendered #25

@robert8888

Description

@robert8888

My page import fonts from adobe cdn. And they are randomly not render correctly. Approx 1 of 10 rendered fonts are not render at all or are used default fallback fonts. I struggle with this and i found solution.

Before render pdf i wait for fonts ready.

  //....
  // Output options if in debug mode
  if (cli.debug) {
    console.log(options);
  }
  await page.evaluateHandle('document.fonts.ready'); // add this line
  await page.pdf(options);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions