Create section properties section

This commit is contained in:
Dolan
2018-01-24 00:01:38 +00:00
parent ff5d02c964
commit df197f73ea
17 changed files with 169 additions and 88 deletions

View File

@ -0,0 +1,13 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPageSizeAttributes {
width: number;
height: number;
}
export class PageSizeAttributes extends XmlAttributeComponent<IPageSizeAttributes> {
protected xmlKeys = {
width: "w:w",
height: "w:h",
};
}

View File

@ -0,0 +1,15 @@
import { XmlComponent } from "file/xml-components";
import { PageSizeAttributes } from "./page-size-attributes";
export class PageSize extends XmlComponent {
constructor(width: number, height: number) {
super("w:pgSz");
this.root.push(
new PageSizeAttributes({
width: width,
height: height,
}),
);
}
}