ability to specify textDirection for section

This commit is contained in:
Katz Sakai
2021-11-19 22:30:38 +09:00
parent c01d3d9f67
commit 9cddfb4ce7
5 changed files with 67 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import { IPageBordersOptions, PageBorders } from "./properties/page-borders";
import { IPageMarginAttributes, PageMargin } from "./properties/page-margin";
import { IPageNumberTypeAttributes, PageNumberType } from "./properties/page-number";
import { IPageSizeAttributes, PageOrientation, PageSize } from "./properties/page-size";
import { PageTDirection, PageTextDirection } from "./properties/page-text-direction";
import { SectionType, Type } from "./properties/section-type";
export interface IHeaderFooterGroup<T> {
@ -29,6 +30,7 @@ export interface ISectionPropertiesOptions {
readonly margin?: IPageMarginAttributes;
readonly pageNumbers?: IPageNumberTypeAttributes;
readonly borders?: IPageBordersOptions;
readonly textDirection?: PageTextDirection;
};
readonly grid?: IDocGridAttributesProperties;
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
@ -108,6 +110,7 @@ export class SectionProperties extends XmlComponent {
} = {},
pageNumbers = {},
borders,
textDirection,
} = {},
grid: { linePitch = 360 } = {},
headerWrapperGroup = {},
@ -152,6 +155,10 @@ export class SectionProperties extends XmlComponent {
this.root.push(new OnOffElement("w:titlePg", titlePage));
}
if (textDirection) {
this.root.push(new PageTDirection(textDirection));
}
this.root.push(new DocumentGrid(linePitch));
}