Skip to content

Commit

Permalink
docs(api.md): add note on page.pdf() color rendering behavior (puppet…
Browse files Browse the repository at this point in the history
…eer#2821)

Adds guidance for producing accurate colors in PDF output. page.pdf() can produce unexpected document colors unless forced to render exact colors.

Fixes puppeteer#2685
  • Loading branch information
kaveet authored and aslushnikov committed Jun 29, 2018
1 parent 871b204 commit acb89dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit acb89dd

Please sign in to comment.