Skip to content

Commit dc4ca39

Browse files
committed
Add page-breaks to readme
1 parent 6ca8c59 commit dc4ca39

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,22 @@ The `opt` parameter has the following optional fields:
4848
|filename |string |'file.pdf' |The default filename of the exported PDF. |
4949
|image |object |{type: 'jpeg', quality: 0.95} |The image type used to generate the PDF. It must have two fields: 'type', the image type ('jpeg'/'png'); and 'quality', the image quality (0-1). See [here](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL) for more info (do not include 'image/' in the 'type' field).|
5050
|enableLinks |boolean |true |If enabled, PDF hyperlinks are automatically added ontop of all anchor tags. |
51-
|html2canvas |object |{ } |Configuration options sent directly to `html2canvas` ([see here](https://github.com/niklasvh/html2canvas) for usage).|
52-
|jsPDF |object |{ } |Configuration options sent directly to `jsPDF` ([see here](https://github.com/MrRio/jsPDF) for usage. |
51+
|html2canvas |object |{ } |Configuration options sent directly to `html2canvas` ([see here](https://html2canvas.hertzen.com/documentation.html#available-options) for usage).|
52+
|jsPDF |object |{ } |Configuration options sent directly to `jsPDF` ([see here](http://rawgit.com/MrRio/jsPDF/master/docs/jsPDF.html) for usage.|
53+
54+
### Extra features
55+
56+
#### Page-breaks
57+
58+
You may add `html2pdf`-specific page-breaks to your document by adding the CSS class `html2pdf__page-break` to any element (normally an empty `div`). During PDF creation, these elements will be given a height calculated to fill the remainder of the PDF page that they are on. Example usage:
59+
60+
```html
61+
<div id="element-to-print">
62+
<span>I'm on page 1!</span>
63+
<div class="html2pdf__page-break"></div>
64+
<span>I'm on page 2!</span>
65+
</div>
66+
```
5367

5468
## Dependencies
5569

0 commit comments

Comments
 (0)