freemarker 操作word,生成带图片的文档在office 2013中打开,图片不能正确显示,在wps中就可以

通过将word模板另存为WordXML文档,freemarker 操作word,生成带图片的文档在office 2013中打开,图片不能正确显示,在wps中就可以,

    <#list key.zsxxImg as imgKey>
                             <#list imgKey.singleImg as img>
                                <w:pict>
                                    <w:binData w:name="${"wordml://"+key_index+imgKey_index+img_index+10000+".jpg"}">
                                          ${img.imgInfo}
                                    </w:binData>
                                    <v:shape id="_x0000_s1026" o:spt="75" alt="1524739911002" type="#_x0000_t75" style="height:${img.imgHeight}px;width:${img.imgWidth}px;" filled="f" o:preferrelative="t" stroked="f" coordsize="21600,21600">
                                        <v:path/>
                                        <v:fill on="f" focussize="0,0" />
                                        <v:stroke on="f" />
                                        <v:imagedata src="${"wordml://"+key_index+imgKey_index+img_index+10000+".jpg"}" o:title="" />
                                        <o:lock v:ext="edit" aspectratio="t" />
                                        <w10:wrap type="none" />
                                        <w10:anchorlock/>
                                    </v:shape>
                                </w:pict>
                          </#list>
                        </#list>

clipboard.png

有知道怎么解决吗?

阅读 5.7k
3 个回答
新手上路,请多包涵

<w:binData w:name="wordml://">${headImg!}</w:binData>

<v:imagedata src="wordml://" o:title="wordml://"/>

标签内不指定具体得文件名就行了 wordml://

推荐问题