Files
docx-js/src/file/paragraph/formatting/page-break.ts

31 lines
667 B
TypeScript
Raw Normal View History

2017-09-21 14:56:46 +01:00
// http://officeopenxml.com/WPtextSpecialContent-break.php
import { Attributes, XmlComponent } from "file/xml-components";
2017-12-19 23:13:11 +00:00
import { Run } from "../run";
2016-03-30 00:28:05 +01:00
2016-04-09 20:16:35 +01:00
class Break extends XmlComponent {
2016-03-30 00:28:05 +01:00
constructor() {
2016-04-09 20:16:35 +01:00
super("w:br");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
type: "page",
}),
);
2016-03-30 00:28:05 +01:00
}
}
export class PageBreak extends Run {
constructor() {
super();
2016-04-09 20:16:35 +01:00
this.root.push(new Break());
2016-03-30 00:28:05 +01:00
}
2017-03-08 21:36:09 +00:00
}
/**
* Add page break before the paragraph if there is no one added before.
*/
export class PageBreakBefore extends XmlComponent {
constructor() {
super("w:pageBreakBefore");
}
}