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 { Document } from "./document";
|
||||
import {
|
||||
FooterReference,
|
||||
FooterReferenceType,
|
||||
HeaderReference,
|
||||
HeaderReferenceType,
|
||||
@ -218,6 +219,32 @@ export class File {
|
||||
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 {
|
||||
const entry = this.footers.map((item) => item.footer).find((h) => h.Footer.ReferenceId === refId);
|
||||
if (entry) {
|
||||
|
Reference in New Issue
Block a user