Merge pull request #363 from moritz-tr/fix/create-document-from-template

fix: docx generation from template
This commit is contained in:
Dolan
2019-08-01 14:26:41 +01:00
committed by GitHub
2 changed files with 55 additions and 52 deletions

View File

@ -10,6 +10,7 @@ export class Footer extends InitializableXmlComponent {
constructor(referenceNumber: number, initContent?: XmlComponent) { constructor(referenceNumber: number, initContent?: XmlComponent) {
super("w:ftr", initContent); super("w:ftr", initContent);
this.refId = referenceNumber; this.refId = referenceNumber;
if (!initContent) {
this.root.push( this.root.push(
new FooterAttributes({ new FooterAttributes({
wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
@ -31,6 +32,7 @@ export class Footer extends InitializableXmlComponent {
}), }),
); );
} }
}
public get ReferenceId(): number { public get ReferenceId(): number {
return this.refId; return this.refId;

View File

@ -11,7 +11,7 @@ export class Header extends InitializableXmlComponent {
super("w:hdr", initContent); super("w:hdr", initContent);
this.refId = referenceNumber; this.refId = referenceNumber;
if (!initContent) {
this.root.push( this.root.push(
new HeaderAttributes({ new HeaderAttributes({
wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
@ -44,6 +44,7 @@ export class Header extends InitializableXmlComponent {
}), }),
); );
} }
}
public get ReferenceId(): number { public get ReferenceId(): number {
return this.refId; return this.refId;