/// <inheritdoc /> public async Task <MemoryStream> Save() { MemoryStream stream = DocxFilePath.Create(); stream = await Document.WriteInto(stream, "word/document.xml"); stream = await Footnotes.WriteInto(stream, "word/footnotes.xml"); stream = await ContentTypes.WriteInto(stream, ContentTypesInfo.Path); stream = await DocumentRelations.WriteInto(stream, DocumentRelsInfo.Path); stream = await FootnoteRelations.WriteInto(stream, "word/_rels/footnotes.xml.rels"); stream = await Styles.WriteInto(stream, "word/styles.xml"); stream = await Numbering.WriteInto(stream, "word/numbering.xml"); stream = await Theme1.WriteInto(stream, "word/theme/theme1.xml"); foreach (ChartInformation item in Charts) { stream = await item.Chart.WriteInto(stream, $"word/{item.Name}"); } return(stream); }
/// <inheritdoc /> public void Save(DocxFilePath result) { if (result is null) { throw new ArgumentNullException(nameof(result)); } Document.WriteInto(result, "word/document.xml"); Footnotes.WriteInto(result, "word/footnotes.xml"); ContentTypes.WriteInto(result, ContentTypesInfo.Path); DocumentRelations.WriteInto(result, DocumentRelsInfo.Path); FootnoteRelations.WriteInto(result, "word/_rels/footnotes.xml.rels"); Styles.WriteInto(result, "word/styles.xml"); Numbering.WriteInto(result, "word/numbering.xml"); Theme1.WriteInto(result, "word/theme/theme1.xml"); foreach (ChartInformation item in Charts) { item.Chart.WriteInto(result, $"word/{item.Name}"); } }