Merge pull request #5824 from electron/cleanup-web-contents

Cleanup the web-contents.js code
This commit is contained in:
Cheng Zhao 2016-06-01 07:14:31 +00:00
commit e46ef5a15a
3 changed files with 72 additions and 67 deletions

View file

@ -691,7 +691,8 @@ size.
* `marginsType` Integer - Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin.
* `pageSize` String - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` & `width` in Microns.
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
and `width` in microns.
* `printBackground` Boolean - Whether to print CSS backgrounds.
* `printSelectionOnly` Boolean - Whether to print selection only.
* `landscape` Boolean - `true` for landscape, `false` for portrait.
@ -714,6 +715,8 @@ By default, an empty `options` will be regarded as:
}
```
An example of `webContents.printToPDF`:
```javascript
const {BrowserWindow} = require('electron');
const fs = require('fs');