private void RenderDocument(string outputFile, Document document) { _wordDocument = DocX.Create(outputFile); RenderParagraph(document.Text, _formatting.DocumentText); foreach (DocumentSection section in document.Sections) { RenderSection(section); } _wordDocument.Save(); }
public RenderResult Render(Document document) { Stopwatch stopwatch = Stopwatch.StartNew(); RenderResult result = new RenderResult { Success = false }; result.OutputFile = Path.Combine(_folderPath, DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + ".docx"); RenderDocument(result.OutputFile, document); result.TimeToRender = stopwatch.ElapsedMilliseconds; return result; }