xml - Image disappears in my docx document after altering and saving it -


i'm generating docx file using java (i'm not using api) , it's working fine except images.

i can add image , generate file , appear there wanted. whenever alter document, save, close re-open image disappears. see transparent square. when open document .zip (after altering , saving) image won't there anymore.

this word/document.xml:

 <?xml version="1.0" encoding="utf-8" standalone="yes"?> <w:document     xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"     xmlns:o="urn:schemas-microsoft-com:office:office"     xmlns:r="http://schemas.openxmlformats.org/officedocument/2006/relationships"     xmlns:m="http://schemas.openxmlformats.org/officedocument/2006/math"     xmlns:v="urn:schemas-microsoft-com:vml"     xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingdrawing"     xmlns:w10="urn:schemas-microsoft-com:office:word"     xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"     xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">     <w:body>         <w:p>             <w:ppr>                 <w:ind w:firstline="0.0" />                 <w:jc w:val="left" />                 <w:rpr></w:rpr>             </w:ppr>             <w:pict>                 <v:shape id="myshape1" type="#_x0000_t75" style="width:200; height:200">                     <v:imagedata r:id="rid10" />                 </v:shape>             </w:pict>         </w:p>         <w:sectpr>             <w:headerreference w:type="default" r:id="rid6" />             <w:footerreference w:type="default" r:id="rid7" />             <w:pgsz w:w="11906.0" w:h="16838.0" />             <w:pgmar w:top="1417.0" w:right="1701.0" w:bottom="1417.0"                 w:left="1701.0" w:header="708" w:footer="708" w:gutter="0" />             <w:cols w:space="708" />             <w:docgrid w:linepitch="360" />         </w:sectpr>     </w:body> </w:document>    

this word/_rels/document.xml.rels:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?> <relationships     xmlns="http://schemas.openxmlformats.org/package/2006/relationships">     <relationship id="rid8"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/fonttable"         target="fonttable.xml" />     <relationship id="rid3"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/websettings"         target="websettings.xml" />     <relationship id="rid7"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/footer"         target="footer1.xml" />     <relationship id="rid2"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/settings"         target="settings.xml" />     <relationship id="rid1"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/styles"         target="styles.xml" />     <relationship id="rid6"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/header"         target="header1.xml" />     <relationship id="rid5"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/endnotes"         target="endnotes.xml" />     <relationship id="rid4"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/footnotes"         target="footnotes.xml" />     <relationship id="rid9"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/theme"         target="theme/theme1.xml" />     <relationship id="rid10"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/image"         target="media/image10.jpg" /> </relationships> 

after save docx how word/_rels/document.xml.rels is:

<?xml version="1.0" encoding="utf-8" standalone="yes"?> <relationships     xmlns="http://schemas.openxmlformats.org/package/2006/relationships">     <relationship id="rid8"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/footer"         target="footer1.xml" />     <relationship id="rid3"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/websettings"         target="websettings.xml" />     <relationship id="rid7"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/header"         target="header1.xml" />     <relationship id="rid2"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/settings"         target="settings.xml" />     <relationship id="rid1"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/styles"         target="styles.xml" />     <relationship id="rid6"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/image"         target="ooxword://word/media/image10.jpg" targetmode="external" />     <relationship id="rid5"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/endnotes"         target="endnotes.xml" />     <relationship id="rid10"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/theme"         target="theme/theme1.xml" />     <relationship id="rid4"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/footnotes"         target="footnotes.xml" />     <relationship id="rid9"         type="http://schemas.openxmlformats.org/officedocument/2006/relationships/fonttable"         target="fonttable.xml" /> </relationships> 

if that's not enough can upload docx file.


Comments