如何为Base64字符串转换为DOC / DOCX在C#中? [英] How to convert base64 string to doc/docx in c#?

查看:825
本文介绍了如何为Base64字符串转换为DOC / DOCX在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的MVC基于Web的项目,并希望的base64字符串转换为 DOC / DOCX 使用文件的 C# ..我已经构思有关的base64转换为图像文件,但没有DOC / DOCX文件,已经搜索了很多,但没有得到任何解决方案。任何人有这个想法...?
在此先感谢..

I am working on mvc web based project, and want to convert base64 string to doc/docx file using c#..I've idea about converting base64 to image file but don't have doc/docx file,have searched a lot but didn't get any solution. anyone have idea about this...? Thanks in advance..

推荐答案

您可以简单地创建RTF文件

You can simply create rtf file

引用添加 System.Windows.Forms的到项目

RichTextBox rtb = new RichTextBox();
rtb.Text = "Base64String";
rtb.Save("Path");

和有关创建 DOCX 文件

使用此开源项目创建 DOCX 文件中像这样

Use this open source project for creating docx file like this

  var doc = DocX.Create("FileName");
  // Insert a paragrpah:
  doc.InsertParagraph("Base64String");
  // Save to the output directory:
 doc.Save();



更多信息:

More information :

如何建立与微软的.docx文档。 Office.Interop.Word?

创建和操纵Word文档

这篇关于如何为Base64字符串转换为DOC / DOCX在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆