Declarative hyperlinks, bookmarks, tab stops and page breaks

This commit is contained in:
Dolan
2019-09-30 22:56:21 +01:00
parent d2dded860d
commit 04b6d8e54a
20 changed files with 207 additions and 165 deletions

View File

@ -244,10 +244,15 @@ The above example will create a heading with a page break directly under it.
## Page Break
To move to a new page (insert a page break), simply add `.pageBreak()` on a paragraph:
To move to a new page (insert a page break):
```ts
const paragraph = new docx.Paragraph("Amazing Heading").pageBreak();
const paragraph = new docx.Paragraph({
children: [
new TextRun("Amazing Heading"),
new PageBreak(),
]
});
```
The above example will create a heading and start a new page immediately afterwards.