Add Add createFirstPageFooter and createEvenPageFooter
This commit is contained in:
@ -3,6 +3,7 @@ import { ContentTypes } from "./content-types/content-types";
|
|||||||
import { CoreProperties, IPropertiesOptions } from "./core-properties";
|
import { CoreProperties, IPropertiesOptions } from "./core-properties";
|
||||||
import { Document } from "./document";
|
import { Document } from "./document";
|
||||||
import {
|
import {
|
||||||
|
FooterReference,
|
||||||
FooterReferenceType,
|
FooterReferenceType,
|
||||||
HeaderReference,
|
HeaderReference,
|
||||||
HeaderReferenceType,
|
HeaderReferenceType,
|
||||||
@ -218,6 +219,32 @@ export class File {
|
|||||||
return headerWrapper;
|
return headerWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public createFirstPageFooter(): FooterWrapper {
|
||||||
|
const footerWrapper = this.createFooter();
|
||||||
|
|
||||||
|
this.document.Body.DefaultSection.addChildElement(
|
||||||
|
new FooterReference({
|
||||||
|
footerType: FooterReferenceType.FIRST,
|
||||||
|
footerId: footerWrapper.Footer.ReferenceId,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
return footerWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public createEvenPageFooter(): FooterWrapper {
|
||||||
|
const footerWrapper = this.createFooter();
|
||||||
|
|
||||||
|
this.document.Body.DefaultSection.addChildElement(
|
||||||
|
new FooterReference({
|
||||||
|
footerType: FooterReferenceType.EVEN,
|
||||||
|
footerId: footerWrapper.Footer.ReferenceId,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
return footerWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
public getFooterByReferenceNumber(refId: number): FooterWrapper {
|
public getFooterByReferenceNumber(refId: number): FooterWrapper {
|
||||||
const entry = this.footers.map((item) => item.footer).find((h) => h.Footer.ReferenceId === refId);
|
const entry = this.footers.map((item) => item.footer).find((h) => h.Footer.ReferenceId === refId);
|
||||||
if (entry) {
|
if (entry) {
|
||||||
|
Reference in New Issue
Block a user