Files
docx-js/src/file/paragraph/formatting/page-break.ts
2019-06-17 01:51:57 +01:00

31 lines
669 B
TypeScript

// http://officeopenxml.com/WPtextSpecialContent-break.php
import { Attributes, XmlComponent } from "file/xml-components";
import { Run } from "../run";
class Break extends XmlComponent {
constructor() {
super("w:br");
this.root.push(
new Attributes({
type: "page",
}),
);
}
}
export class PageBreak extends Run {
constructor() {
super({});
this.root.push(new Break());
}
}
/**
* Add page break before the paragraph if there is no one added before.
*/
export class PageBreakBefore extends XmlComponent {
constructor() {
super("w:pageBreakBefore");
}
}