Update documentation
This commit is contained in:
@ -305,4 +305,12 @@ Example: https://github.com/dolanmiu/docx/blob/master/demo/15-page-break-before.
|
||||
|
||||
## Page break control
|
||||
|
||||
Paragraphs have `.keepLines()` and `.keepNext()` methods that allow restricting page breaks within and between paragraphs. See [this Microsoft article](https://support.office.com/en-us/article/Keep-lines-and-paragraphs-together-d72af534-926f-4c4b-830a-abfc2daa3bfa) for more details)
|
||||
Paragraphs have `keepLines` and `keepNext` properties that allow restricting page breaks within and between paragraphs. See [this Microsoft article](https://support.office.com/en-us/article/Keep-lines-and-paragraphs-together-d72af534-926f-4c4b-830a-abfc2daa3bfa) for more details.
|
||||
|
||||
```ts
|
||||
const paragraph = new Paragraph({
|
||||
text: "Stay on the same page",
|
||||
keepLines: true,
|
||||
keepNext: true,
|
||||
});
|
||||
```
|
||||
|
@ -23,7 +23,13 @@ export interface ILevelParagraphStylePropertiesOptions {
|
||||
readonly leftTabStop?: number;
|
||||
readonly indent?: IIndentAttributesProperties;
|
||||
readonly spacing?: ISpacingProperties;
|
||||
/**
|
||||
* Specifies that the paragraph (or at least part of it) should be rendered on the same page as the next paragraph when possible. If multiple paragraphs are to be kept together but they exceed a page, then the set of paragraphs begin on a new page and page breaks are used thereafter as needed.
|
||||
*/
|
||||
readonly keepNext?: boolean;
|
||||
/**
|
||||
* Specifies that all lines of the paragraph are to be kept on a single page when possible.
|
||||
*/
|
||||
readonly keepLines?: boolean;
|
||||
readonly outlineLevel?: number;
|
||||
}
|
||||
|
Reference in New Issue
Block a user