【问题标题】:How to insert images directly in openXML document.xml如何在 openXML document.xml 中直接插入图像
【发布时间】:2012-08-03 10:52:27
【问题描述】:

我需要在 openXML 中调用本地图像并使用 XSLT 将这些图像的 XML 转换为 Word,我想直接插入图像而不是在 document_rels 文件中调用。

我使用下面的标签来调用图像 'blue_hills.jpg in C' 驱动器

   <w:pict>
    <v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:250; height:200">
     <v:imagedata src="c:\Blue_hills.jpg"/>
    </v:shape>
   </w:pict>

任何帮助将不胜感激。

【问题讨论】:

    标签: xml xslt openxml openxml-sdk


    【解决方案1】:

    你不能那样做。图像被转换为​​二进制并作为图像部分添加到文档中。 XML 中 imagedata 的属性 src 无效。它只存储图像部分的关系 ID。

    link 解释了 Open XML for document with image。

    这是一个 example 以编程方式插入图像。

    【讨论】:

      猜你喜欢
      • 2012-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-23
      相关资源
      最近更新 更多