首页 > 解决方案 > officeJS Word 加载项加载带有图像的页脚

问题描述

我们正在尝试以编程方式从 ooxml 文本加载页脚/页眉。当我们在页脚/页眉中有图像时,就会出现问题。我们正在使用

item.getFooter("primary").insertOoxml(ooxml, "replace");

我们如何通过使用 javascript API 以编程方式在文档中创建图像关系 r:Id?

或者也许还有另一种在标题中设置图像的方法......

下面是我们从标头中获取的 xml:

<?xml version="1.0" encoding="UTF-8"?>
<w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
   <w:pPr>
      <w:rPr>
         <w:sz w:val="22" />
      </w:rPr>
   </w:pPr>
   <w:r>
      <w:rPr>
         <w:sz w:val="22" />
      </w:rPr>
      <w:pict>
    
         <v:shape xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" id="Picture 1" style="height:40.85pt;visibility:visible;width:40.85pt" o:spid="_x0000_i2049" filled="t" stroked="f" type="#_x0000_t75">
            <v:imagedata xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" o:title="" r:id="rId1" />
            <o:lock v:ext="edit" aspectratio="t" />
         </v:shape>
      </w:pict>
   </w:r>
</w:p>

标签: javascriptms-wordoffice-js

解决方案


推荐阅读