You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,13 +49,33 @@ It returns the full HTML extracted from the URL.
49
49
50
50
### .pdf(url, [opts], [cb])
51
51
52
-
`opts` provided are passed to [page.goto](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options).
52
+
It generates the PDF version of a website behing an URL.
53
+
54
+
`opts` provided are passed to [page.pdf](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions).
55
+
56
+
It returns an [tmpStream](https://github.com/Kikobeats/create-temp-file2#create-temp-file2), with `path` where the temporal file live and `cleanup`/`cleanupSync` methods for clean the temporal file.
57
+
58
+
If you want to customize where tmpStream live, pass [opts.tmpOptions](https://github.com/Kikobeats/create-temp-file2#createtempfileoptions).
53
59
54
60
Additionally, you can setup:
55
61
56
-
### media
62
+
#### media
63
+
64
+
Changes the CSS media type of the page using [page.emulateMedia](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageemulatemediamediatype).
65
+
66
+
#### device
67
+
68
+
Providing a valid [deviceDescriptor](https://github.com/GoogleChrome/puppeteer/blob/master/DeviceDescriptors.js) object.
69
+
70
+
The device will be used to recover and setup `userAgent` and `viewport`.
71
+
72
+
#### userAgent
73
+
74
+
It will setup User Agent using [page.setUserAgent](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetuseragentuseragent) method.
57
75
58
-
Providing a valid [page.emulateMedia](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageemulatemediamediatype) value. Default is `'screen'`.
76
+
#### viewport
77
+
78
+
Providing a valid [page.setViewport](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetviewportviewport) object.
59
79
60
80
### .screenshot(url, [opts], [cb])
61
81
@@ -73,11 +93,11 @@ Additionally, you can setup:
73
93
74
94
Providing a valid [deviceDescriptor](https://github.com/GoogleChrome/puppeteer/blob/master/DeviceDescriptors.js) object.
75
95
76
-
#### userAgent
96
+
The device will be used to recover and setup `userAgent` and `viewport`.
77
97
78
-
It will setup an user Agent using
98
+
#### userAgent
79
99
80
-
Providing a valid[page.setUserAgent](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetuseragentuseragent) method.
100
+
It will setup User Agent using[page.setUserAgent](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetuseragentuseragent) method.
0 commit comments