0

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

leppie
  • 115,091
  • 17
  • 196
  • 297
Nimesh khatri
  • 763
  • 12
  • 29

1 Answers1

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

Community
  • 1
  • 1
mohsen
  • 1,763
  • 3
  • 17
  • 55