From acb89dddba21d4fd5d1be7f4c8dce17d3cbc223f Mon Sep 17 00:00:00 2001 From: Kaveet Laxmidas Date: Fri, 29 Jun 2018 11:57:03 -0500 Subject: [PATCH] docs(api.md): add note on page.pdf() color rendering behavior (#2821) Adds guidance for producing accurate colors in PDF output. page.pdf() can produce unexpected document colors unless forced to render exact colors. Fixes #2685 --- docs/api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api.md b/docs/api.md index 07991ecb911..8e21d958e64 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1250,6 +1250,8 @@ Page is guaranteed to have a main frame which persists during navigations. `page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call [page.emulateMedia('screen')](#pageemulatemediamediatype) before calling `page.pdf()`: +> **NOTE** By default, `page.pdf()` generates a pdf with modified colors for printing. Use the [`-webkit-print-color-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to force rendering of exact colors. + ```js // Generates a PDF with 'screen' media type. await page.emulateMedia('screen');