How to convert base64 string to doc/docx in c#?

浪尽此生 提交于 2020-01-03 04:56:08

问题


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..


回答1:


You can simply create rtf file

Add system.windows.forms reference to your project

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

And about creating docx file

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 :

How do I create the .docx document with Microsoft.Office.Interop.Word?

Create and Manipulate Word Documents



来源:https://stackoverflow.com/questions/37496108/how-to-convert-base64-string-to-doc-docx-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!