mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(page): add 'preferCSSPageSize' to page.pdf options (#2928)
Fixes #1963.
This commit is contained in:
committed by
Andrey Lushnikov
parent
78ebf401c2
commit
12e3510eca
@@ -1277,6 +1277,7 @@ Page is guaranteed to have a main frame which persists during navigations.
|
||||
- `right` <[string]> Right margin, accepts values labeled with units.
|
||||
- `bottom` <[string]> Bottom margin, accepts values labeled with units.
|
||||
- `left` <[string]> Left margin, accepts values labeled with units.
|
||||
- `preferCSSPageSize` <[boolean]> Give any CSS `@page` size declared in the page priority over what is declared in `width` and `height` or `format` options. Defaults to `false`, which will scale the content to fit the paper size.
|
||||
- returns: <[Promise]<[Buffer]>> Promise which resolves with PDF buffer.
|
||||
|
||||
> **NOTE** Generating a pdf is currently only supported in Chrome headless.
|
||||
|
||||
Reference in New Issue
Block a user