Landscape mode

This commit is contained in:
Dolan
2018-01-25 01:47:47 +00:00
parent 4339f8cfc0
commit 355e97cb5e
4 changed files with 24 additions and 4 deletions

View File

@ -2,13 +2,16 @@ import { XmlComponent } from "file/xml-components";
import { PageSizeAttributes } from "./page-size-attributes";
export class PageSize extends XmlComponent {
constructor(width: number, height: number) {
constructor(width: number, height: number, orientation: string) {
super("w:pgSz");
const flip = orientation === "landscape";
this.root.push(
new PageSizeAttributes({
width: width,
height: height,
width: flip ? height : width,
height: flip ? width : height,
orientation: orientation,
}),
);
}