Skip to content

Commit

Permalink
docs: clarify headerTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed May 9, 2022
1 parent f01e26e commit 4a9c361
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions docs/api/web-contents.md
Expand Up @@ -1472,12 +1472,7 @@ win.webContents.print(options, (success, errorType) => {
* `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches).
* `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
* `ignoreInvalidPageRanges` boolean (optional) - Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:
* `date`: formatted print date
* `title`: document title
* `url`: document location
* `pageNumber`: current page number
* `totalPages`: total pages in the document
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `<span class=title></span>` would generate span containing the title.
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.

Expand Down
7 changes: 1 addition & 6 deletions docs/api/webview-tag.md
Expand Up @@ -578,12 +578,7 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
* `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches).
* `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
* `ignoreInvalidPageRanges` boolean (optional) - Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:
* `date`: formatted print date
* `title`: document title
* `url`: document location
* `pageNumber`: current page number
* `totalPages`: total pages in the document
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `<span class=title></span>` would generate span containing the title.
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.

Expand Down

0 comments on commit 4a9c361

Please sign in to comment.