简体   繁体   English

如果我具有Base64编码的字符串,如何使用DocumentFormat.OpenXML将图像绘制到MS Word文档中?

[英]How to paint image into MS Word document using DocumentFormat.OpenXML if I have a Base64 encoded string?

我有一个Base64编码的字符串,我希望将其转换为图像并使用DocumentFormat.openXML在Word文档中进行绘制

as regular binary images. 作为常规的二进制图像。 for get bytes use Convert.FromBase64String(theBase64string) , and for stream use MemoryStream : 要获取字节,请使用Convert.FromBase64String(theBase64string) ;对于流,请使用MemoryStream

using(var m = new MemoryStream(Convert.FromBase64String(theBase64string)))
{
    //here, same code to insert regular binary images
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将Microsoft Word文档节或段落设置为仅使用DocumentFormat.OpenXml进行读取 - How to set Microsoft Word document section or paragraph to read only using DocumentFormat.OpenXml DocumentFormat.OpenXml将图像添加到Word文档 - DocumentFormat.OpenXml Adding an Image to a word doc 使用DocumentFormat.OpenXml替换Word中的数据 - Replacing data in word using DocumentFormat.OpenXml 使用DocumentFormat.OpenXml(c#)合并Word文档 - Merging word-documents using DocumentFormat.OpenXml(c#) 使用DocumentFormat.OpenXml(C#)更新.docx文档中的目录 - Update TOC in .docx document using DocumentFormat.OpenXml (C#) 使用DocumentFormat.OpenXml从单词获取文本 - get text from word using DocumentFormat.OpenXml 如何使用DocumentFormat.OpenXml在Word模板中编辑书签并将其另存为新的PDF文件? - How to edit bookmarks in a Word template using DocumentFormat.OpenXml and save it as a new PDF file? 如何使用DocumentFormat.OpenXml C#获取excel工作表中的特定列? - How can I get the specific column in excel worksheet using DocumentFormat.OpenXml C#? DocumentFormat.OpenXml修改文档的创建者属性 - DocumentFormat.OpenXml Modify Creator Propery of Document 我有单词编码的Base64字符串。 我只想阅读内容。 怎么做? - I have word encoded Base64 string. I want to read the contents only. how to do it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM