From f9abc8ea03c538070b60f92deffe5489664e2d5e Mon Sep 17 00:00:00 2001 From: Eric Bidelman Date: Mon, 28 Aug 2017 10:31:35 -0700 Subject: [PATCH] readme: move up note about Page.pdf working on headless only (#577) Hard to find. From https://github.com/GoogleChrome/puppeteer/issues/576 --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index f6a5d475..173b660d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -604,6 +604,8 @@ Page is guaranteed to have a main frame which persists during navigations. - `left` <[string]> Left margin, accepts values labeled with units. - returns: <[Promise]<[Buffer]>> Promise which resolves with PDF buffer. +> **NOTE** Generating a pdf is currently only supported in Chrome headless. + `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()`: ```js @@ -637,8 +639,6 @@ The `format` options are: - `A4`: 8.27in x 11.7in - `A5`: 5.83in x 8.27in -> **NOTE** Generating a pdf is currently only supported in Chrome headless. - #### page.plainText() - returns: <[Promise]<[string]>> Returns page's inner text.