add ability to vertically align content of section

This commit is contained in:
alexbogomolov
2019-10-29 12:55:15 +02:00
parent 43ddeec6e1
commit 2276572902
6 changed files with 72 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import { IPageNumberTypeAttributes, PageNumberType } from "./page-number";
import { PageSize } from "./page-size/page-size";
import { IPageSizeAttributes, PageOrientation } from "./page-size/page-size-attributes";
import { TitlePage } from "./title-page/title-page";
import { ISectionVerticalAlignAttributes, SectionVerticalAlign } from "./vertical-align";
export interface IHeaderFooterGroup<T> {
readonly default?: T;
@ -45,7 +46,8 @@ export type SectionPropertiesOptions = IPageSizeAttributes &
IPageNumberTypeAttributes &
ILineNumberAttributes &
IPageBordersOptions &
ITitlePageOptions & {
ITitlePageOptions &
ISectionVerticalAlignAttributes & {
readonly column?: {
readonly space?: number;
readonly count?: number;
@ -87,6 +89,7 @@ export class SectionProperties extends XmlComponent {
pageBorderBottom,
pageBorderLeft,
titlePage = false,
valign,
} = options;
this.options = options;
@ -121,6 +124,10 @@ export class SectionProperties extends XmlComponent {
if (titlePage) {
this.root.push(new TitlePage());
}
if (valign) {
this.root.push(new SectionVerticalAlign(valign));
}
}
private addHeaders(headers?: IHeaderFooterGroup<HeaderWrapper>): void {