opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.19k stars 368 forks source link

<w:pict> images are not replaced in DOCX template #670

Open SuperPat45 opened 1 month ago

SuperPat45 commented 1 month ago

Sometime image appear as a element in document.xml witch is not supported by XDocReport:

<w:bookmarkStart w:id="0" w:name="image1"/>
<w:r>
    <w:rPr>
        <w:noProof/>
    </w:rPr>
    <w:pict w14:anchorId="1E9F6AB7">
        <v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:5in;height:559.5pt">
            <v:imagedata r:id="rId6" o:title="Image 1"/>
        </v:shape>
    </w:pict>
</w:r>
<w:bookmarkEnd w:id="0"/>

Instead of a element :

<w:bookmarkStart w:id="0" w:name="image1"/>
<w:r>
    <w:rPr>
        <w:noProof/>
    </w:rPr>
    <w:drawing>
        <wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="6741F81E" wp14:editId="52A9117C">
            <wp:extent cx="228632" cy="228632"/>
            <wp:effectExtent l="0" t="0" r="0" b="0"/>
            <wp:docPr id="2" name="Image 2"/>
            <wp:cNvGraphicFramePr>
                <a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/>
            </wp:cNvGraphicFramePr>
            <a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
                <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
                    <pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
                        <pic:nvPicPr>
                            <pic:cNvPr id="2" name="Image 1"/>
                            <pic:cNvPicPr/>
                        </pic:nvPicPr>
                        <pic:blipFill>
                            <a:blip r:embed="rId4">
                                <a:extLst>
                                    <a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
                                        <a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/>
                                    </a:ext>
                                </a:extLst>
                            </a:blip>
                            <a:stretch>
                                <a:fillRect/>
                            </a:stretch>
                        </pic:blipFill>
                        <pic:spPr>
                            <a:xfrm>
                                <a:off x="0" y="0"/>
                                <a:ext cx="228632" cy="228632"/>
                            </a:xfrm>
                            <a:prstGeom prst="rect">
                                <a:avLst/>
                            </a:prstGeom>
                        </pic:spPr>
                    </pic:pic>
                </a:graphicData>
            </a:graphic>
        </wp:inline>
    </w:drawing>
</w:r>
<w:bookmarkEnd w:id="0"/>

XDocReport need to support image replacement or eventually convert the in during generation.

I don't understand when it create instead of .