Added mirror margins options
This commit is contained in:
@ -8,6 +8,7 @@ export interface IPageMarginAttributes {
|
||||
header?: number;
|
||||
footer?: number;
|
||||
gutter?: number;
|
||||
mirror?: boolean;
|
||||
}
|
||||
|
||||
export class PageMarginAttributes extends XmlAttributeComponent<IPageMarginAttributes> {
|
||||
@ -19,5 +20,6 @@ export class PageMarginAttributes extends XmlAttributeComponent<IPageMarginAttri
|
||||
header: "w:header",
|
||||
footer: "w:footer",
|
||||
gutter: "w:gutter",
|
||||
mirror: "w:mirrorMargins",
|
||||
};
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import { XmlComponent } from "file/xml-components";
|
||||
import { PageMarginAttributes } from "./page-margin-attributes";
|
||||
|
||||
export class PageMargin extends XmlComponent {
|
||||
constructor(top: number, right: number, bottom: number, left: number, header: number, footer: number, gutter: number) {
|
||||
constructor(top: number, right: number, bottom: number, left: number, header: number, footer: number, gutter: number, mirror: boolean) {
|
||||
super("w:pgMar");
|
||||
this.root.push(
|
||||
new PageMarginAttributes({
|
||||
@ -13,6 +13,7 @@ export class PageMargin extends XmlComponent {
|
||||
header: header,
|
||||
footer: footer,
|
||||
gutter: gutter,
|
||||
mirror: mirror,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ export class SectionProperties extends XmlComponent {
|
||||
header: 708,
|
||||
footer: 708,
|
||||
gutter: 0,
|
||||
mirror: false,
|
||||
space: 708,
|
||||
linePitch: 360,
|
||||
orientation: PageOrientation.PORTRAIT,
|
||||
@ -69,6 +70,7 @@ export class SectionProperties extends XmlComponent {
|
||||
mergedOptions.header,
|
||||
mergedOptions.footer,
|
||||
mergedOptions.gutter,
|
||||
mergedOptions.mirror,
|
||||
),
|
||||
);
|
||||
this.root.push(new Columns(mergedOptions.space));
|
||||
|
Reference in New Issue
Block a user