Thanks for your inquiry.
Our Spire.Doc doesn't support inserting base64 data into Word directly. But you can save the base64 to image file, and then insert the image into Word using our Spire.Doc. Here is the code for your reference. If there is still any question, please feel free to write back.
- Code: Select all
string[] str = base64Str.Split(',');
//convert base64 to image
byte[] imageBytes = Convert.FromBase64String(str[1]);
MemoryStream memoryStream = new MemoryStream(imageBytes, 0,imageBytes.Length);
memoryStream.Write(imageBytes, 0, imageBytes.Length);
Image image = Image.FromStream(memoryStream);
Document document = new Document();
//create a section
Section section = document.AddSection();
//create a paragraph
Paragraph paragraph = section.AddParagraph();
//append the image in document
paragraph.AppendPicture(image);
//save the document
document.SaveToFile("result.docx", FileFormat.Docx);
Sincerely,
Lynn
E-iceblue support team