Fix missing media in Document Template

This commit is contained in:
Dolan
2019-01-04 00:11:50 +00:00
parent f7c372a85c
commit e3bcad6d3c
4 changed files with 28 additions and 10 deletions

View File

@ -56,12 +56,13 @@ export class File {
this.coreProperties = new CoreProperties(options);
this.numbering = new Numbering();
this.docRelationships = new Relationships();
this.media = new Media();
this.fileRelationships = new Relationships();
this.appProperties = new AppProperties();
this.footNotes = new FootNotes();
this.contentTypes = new ContentTypes();
this.media = fileProperties.template && fileProperties.template.media ? fileProperties.template.media : new Media();
if (fileProperties.template) {
this.currentRelationshipId = fileProperties.template.currentRelationshipId + 1;
}
@ -108,8 +109,9 @@ export class File {
this.settings = new Settings();
}
public addTableOfContents(toc: TableOfContents): void {
public addTableOfContents(toc: TableOfContents): File {
this.document.addTableOfContents(toc);
return this;
}
public addParagraph(paragraph: Paragraph): File {
@ -121,8 +123,9 @@ export class File {
return this.document.createParagraph(text);
}
public addTable(table: Table): void {
return this.document.addTable(table);
public addTable(table: Table): File {
this.document.addTable(table);
return this;
}
public createTable(rows: number, cols: number): Table {