Add Header and Footer wrapper for their own relationship classes

This commit is contained in:
Dolan
2018-01-31 00:31:54 +00:00
parent df701be572
commit 6d0a267ba4
8 changed files with 138 additions and 38 deletions

View File

@ -42,8 +42,10 @@ export class Compiler {
});
const xmlNumbering = xml(this.formatter.format(this.file.Numbering));
const xmlRelationships = xml(this.formatter.format(this.file.Relationships));
const xmlHeader = xml(this.formatter.format(this.file.Header));
const xmlFooter = xml(this.formatter.format(this.file.Footer));
const xmlHeader = xml(this.formatter.format(this.file.Header.Header));
const xmlFooter = xml(this.formatter.format(this.file.Footer.Footer));
const xmlHeaderRelationships = xml(this.formatter.format(this.file.Header.Relationships));
const xmlFooterRelationships = xml(this.formatter.format(this.file.Footer.Relationships));
this.archive.append(xmlDocument, {
name: "word/document.xml",
@ -73,6 +75,14 @@ export class Compiler {
name: "word/_rels/document.xml.rels",
});
this.archive.append(xmlHeaderRelationships, {
name: "word/_rels/header1.xml.rels",
});
this.archive.append(xmlFooterRelationships, {
name: "word/_rels/footer1.xml.rels",
});
for (const data of this.file.Media.array) {
this.archive.append(data.stream, {
name: `word/media/${data.fileName}`,