diff --git a/src/file/content-types/content-types.ts b/src/file/content-types/content-types.ts index c7246be57c..e28397f4d5 100644 --- a/src/file/content-types/content-types.ts +++ b/src/file/content-types/content-types.ts @@ -20,13 +20,28 @@ export class ContentTypes extends XmlComponent { this.root.push(new Default("application/vnd.openxmlformats-package.relationships+xml", "rels")); this.root.push(new Default("application/xml", "xml")); - this.root.push(new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", undefined, "/word/document.xml")); - this.root.push(new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", undefined, "/word/header1.xml")); - this.root.push(new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", undefined, "/word/footer1.xml")); - this.root.push(new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml", undefined, "/word/styles.xml")); + this.root.push( + new Default( + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", + undefined, + "/word/document.xml", + ), + ); + this.root.push( + new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", undefined, "/word/header1.xml"), + ); + this.root.push( + new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", undefined, "/word/footer1.xml"), + ); + this.root.push( + new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml", undefined, "/word/styles.xml"), + ); this.root.push(new Default("application/vnd.openxmlformats-package.core-properties+xml", undefined, "/docProps/core.xml")); - this.root.push(new Default("application/vnd.openxmlformats-officedocument.extended-properties+xml", undefined, "/docProps/app.xml")); - this.root.push(new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", undefined, "/word/numbering.xml")); - + this.root.push( + new Default("application/vnd.openxmlformats-officedocument.extended-properties+xml", undefined, "/docProps/app.xml"), + ); + this.root.push( + new Default("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", undefined, "/word/numbering.xml"), + ); } } diff --git a/src/file/file.ts b/src/file/file.ts index e9cc8b0bae..ac81e1c24d 100644 --- a/src/file/file.ts +++ b/src/file/file.ts @@ -40,18 +40,46 @@ export class File { this.coreProperties = new CoreProperties(options); this.numbering = new Numbering(); this.docRelationships = new Relationships(); - this.docRelationships.createRelationship(1, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", "styles.xml"); - this.docRelationships.createRelationship(2, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering", "numbering.xml"); - this.docRelationships.createRelationship(3, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", "header1.xml"); - this.docRelationships.createRelationship(4, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", "footer1.xml"); + this.docRelationships.createRelationship( + 1, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", + "styles.xml", + ); + this.docRelationships.createRelationship( + 2, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering", + "numbering.xml", + ); + this.docRelationships.createRelationship( + 3, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", + "header1.xml", + ); + this.docRelationships.createRelationship( + 4, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", + "footer1.xml", + ); this.media = new Media(); this.headerWrapper = new HeaderWrapper(this.media); this.footerWrapper = new FooterWrapper(this.media); this.contentTypes = new ContentTypes(); this.fileRelationships = new Relationships(); - this.fileRelationships.createRelationship(1, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "word/document.xml"); - this.fileRelationships.createRelationship(2, "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", "docProps/core.xml"); - this.fileRelationships.createRelationship(3, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", "docProps/app.xml"); + this.fileRelationships.createRelationship( + 1, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", + "word/document.xml", + ); + this.fileRelationships.createRelationship( + 2, + "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", + "docProps/core.xml", + ); + this.fileRelationships.createRelationship( + 3, + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", + "docProps/app.xml", + ); } public addParagraph(paragraph: Paragraph): void {