Hello all, I've recently decided to switch from using VML to put images into my OpenXML documents to using drawingML, except I cannot get something up and running with DrawingML. I'm trying to do something basic, and this is what I've come up with from the example I found on here and the spec (trying to embed two pictures):
...
<w:p> <w:pPr/> <w:drawing> <wp:inline> <wp:extent cx="3000000" cy="3000000"/> <wp:docPr name="desktop.jpg" id="1"/> <a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"> <pic:pic xlmns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"> <pic:blipFill> <a:blip r:embed="rId_1"/> <a:stretch> <a:fillRect/> </a:stretch> </pic:blipFill> <pic:spPr> <a:xfrm> <a:off x="0" y="0"/> <a:ext cx="3000000" cy="3000000"/> </a:xfrm> <a:prstGeom prst="rect"/> </pic:spPr> </pic:pic> </a:graphicData> </a:graphic> </wp:inline> </w:drawing> </w:p> <w:p> <w:pPr/> <w:drawing> <wp:inline> <wp:extent cx="3000000" cy="3000000"/> <wp:docPr name="DarthVader.png" id="2"/> <a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"> <pic:pic xlmns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"> <pic:blipFill> <a:blip r:embed="rId_2"/> <a:stretch> <a:fillRect/> </a:stretch> </pic:blipFill> <pic:spPr> <a:xfrm> <a:off x="0" y="0"/> <a:ext cx="3000000" cy="3000000"/> </a:xfrm> <a:prstGeom prst="rect"/> </pic:spPr> </pic:pic> </a:graphicData> </a:graphic> </wp:inline> </w:drawing> </w:p>
When attempting to view the resultant document.xml file, I get "The operation completed successfully. Error processing resource..", the serchfilterhost process eats up all the cycles on one core, and Word will freeze if I try to load the .docx. Can anyone help me out here? Thanks!
Nevermind, I found it, typo on "xmlns". Ugh, I really wish there was a little bit more informative error reporting by word on malformed docx files!
Edit: The nvPicpr element appears to be mandatory, this solved my problems.