[HttpGet("downloadWordTemplate")]
public IActionResult DownloadWordFromTemplatePath()
{
string templatePath = "wordTemplate.docx";
Dictionary<string, object> value = new Dictionary<string, object>();
MemoryStream memoryStream = new MemoryStream();
MiniWord.SaveAsByTemplate(memoryStream, templatePath, value);
memoryStream.Seek(0, SeekOrigin.Begin);
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
{
FileDownloadName = "demo.docx"
};
}
MiniWord导出
最新推荐文章于 2024-07-25 12:46:10 发布