Page 1 of 1

How to Create a Tight Wrapped Anchored Image

PostPosted: Fri Sep 18, 2015 2:09 am
by michaelgeorge
I read through pages of white papers online and can't find a straight answer as to how to create a tight wrapped anchored image. I have tried a few solutions that got me close to what I need but I cannot get a full solution. Here's the code that I currently have....

Using a solution I found here http://www.docx4java.org/forums/docx-java-f6/inline-vs-anchor-images-t726.html by tstirrat ยป Sat Sep 29, 2012 2:29 pm

Code: Select all
   public static void createAnchor(org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage, org.docx4j.wml.ObjectFactory factory, byte[] bytes, String filenameHint, String altText, int id1, int id2) throws Exception {

      org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes);

      org.docx4j.dml.wordprocessingDrawing.Inline inline = imagePart.createImageInline(filenameHint, altText, id1, id2, false);

      // convert the inline to an anchor (xml contents are essentially the same)
      String anchorXml = XmlUtils.marshaltoString(inline, true, false, Context.jc, Namespaces.NS_WORD12, "anchor", Inline.class);

      org.docx4j.dml.ObjectFactory dmlFactory = new org.docx4j.dml.ObjectFactory();
      org.docx4j.dml.wordprocessingDrawing.ObjectFactory wordDmlFactory = new org.docx4j.dml.wordprocessingDrawing.ObjectFactory();

      Anchor anchor = (Anchor) XmlUtils.unmarshalString(anchorXml, Context.jc, Anchor.class);
      anchor.setSimplePos(dmlFactory.createCTPoint2D());
      anchor.getSimplePos().setX(0L);
      anchor.getSimplePos().setY(0L);
      anchor.setSimplePosAttr(false);
      anchor.setPositionH(wordDmlFactory.createCTPosH());
      anchor.getPositionH().setAlign(STAlignH.RIGHT);
      anchor.getPositionH().setRelativeFrom(STRelFromH.MARGIN);
      anchor.setPositionV(wordDmlFactory.createCTPosV());
      anchor.getPositionV().setPosOffset(0);
      anchor.getPositionV().setRelativeFrom(STRelFromV.PAGE);
      anchor.setWrapNone(wordDmlFactory.createCTWrapNone());

      // Now add the inline in w:p/w:r/w:drawing
      org.docx4j.wml.Drawing drawing = getFactory().createDrawing();
      R run = getFactory().createR();
      run.getContent().add(drawing);

      drawing.getAnchorOrInline().add(anchor);
      org.docx4j.wml.P  p = factory.createP();
      p.getContent().add(run);
      wordMLPackage.getMainDocumentPart().addObject(p);
   }


This solution actually works but it sets the picture to the top right of the page as a floating image in front of text. But what I want to do is create a tight wrapped image (see enclosed sample.docx) so that text can flow around it and not behind/in front of the image. I tried changing anchor.setWrapNone(wordDmlFactory.createCTWrapNone()); to anchor.setWrapTight(wordDmlFactory.createCTWrapTight()); but the document opens with an error. I am fairly new to docx4j and have read through (as best I can) the various documents available online. But I am still unable to get the desired solution. Can anyone please help me get this accomplished? Thanks.

Re: How to Create a Tight Wrapped Anchored Image

PostPosted: Sun Sep 20, 2015 9:43 pm
by jason
Your docx contains:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
        <w:drawing>
          <wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="0" relativeHeight="251658240" behindDoc="1" locked="0" layoutInCell="1" allowOverlap="1">
            <wp:simplePos x="0" y="0"/>
            <wp:positionH relativeFrom="column">
              <wp:posOffset>4152900</wp:posOffset>
            </wp:positionH>
            <wp:positionV relativeFrom="paragraph">
              <wp:posOffset>0</wp:posOffset>
            </wp:positionV>
            <wp:extent cx="1903016" cy="1304925"/>
            <wp:effectExtent l="0" t="0" r="2540" b="0"/>
            <wp:wrapTight wrapText="bothSides">
              <wp:wrapPolygon edited="0">
                <wp:start x="0" y="0"/>
                <wp:lineTo x="0" y="21127"/>
                <wp:lineTo x="21413" y="21127"/>
                <wp:lineTo x="21413" y="0"/>
                <wp:lineTo x="0" y="0"/>
              </wp:wrapPolygon>
            </wp:wrapTight>
            <wp:docPr id="1" name="Picture 1" descr="http://louisianalawblog.wp.lexblogs.com/wp-content/uploads/sites/342/2015/02/app.jpg"/>
            <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="0" name="Picture 1" descr="http://louisianalawblog.wp.lexblogs.com/wp-content/uploads/sites/342/2015/02/app.jpg"/>
                    <pic:cNvPicPr>
                      <a:picLocks noChangeAspect="1" noChangeArrowheads="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:srcRect/>
                    <a:stretch>
                      <a:fillRect/>
                    </a:stretch>
                  </pic:blipFill>
                  <pic:spPr bwMode="auto">
                    <a:xfrm>
                      <a:off x="0" y="0"/>
                      <a:ext cx="1903016" cy="1304925"/>
                    </a:xfrm>
                    <a:prstGeom prst="rect">
                      <a:avLst/>
                    </a:prstGeom>
                    <a:noFill/>
                    <a:ln>
                      <a:noFill/>
                    </a:ln>
                  </pic:spPr>
                </pic:pic>
              </a:graphicData>
            </a:graphic>
          </wp:anchor>
        </w:drawing>
 
Parsed in 0.006 seconds, using GeSHi 1.0.8.4


Looks like you need, inter alia, wp:wrapTight/@wrapText="bothSides"

You can generate this code, at http://webapp.docx4java.org/OnlineDemo/PartsList.html or by using the Docx4j Helper Word Addin.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
    CTWrapTight wraptight = dmlwordprocessingDrawingObjectFactory.createCTWrapTight();
    anchor.setWrapTight(wraptight);
        wraptight.setWrapText(org.docx4j.dml.wordprocessingDrawing.STWrapText.BOTH_SIDES);
        // Create object for wrapPolygon
        CTWrapPath wrappath = dmlwordprocessingDrawingObjectFactory.createCTWrapPath();
        wraptight.setWrapPolygon(wrappath);
org.docx4j.dml.ObjectFactory dmlObjectFactory = new org.docx4j.dml.ObjectFactory();
            // Create object for lineTo
            CTPoint2D point2d = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d);
                point2d.setY( 21127 );
                point2d.setX( 0 );
            // Create object for lineTo
            CTPoint2D point2d2 = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d2);
                point2d2.setY( 21127 );
                point2d2.setX( 21413 );
            // Create object for lineTo
            CTPoint2D point2d3 = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d3);
                point2d3.setY( 0 );
                point2d3.setX( 21413 );
            // Create object for lineTo
            CTPoint2D point2d4 = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d4);
                point2d4.setY( 0 );
                point2d4.setX( 0 );
            // Create object for start
            CTPoint2D point2d5 = dmlObjectFactory.createCTPoint2D();
            wrappath.setStart(point2d5);
                point2d5.setY( 0 );
                point2d5.setX( 0 );
 
Parsed in 0.017 seconds, using GeSHi 1.0.8.4


If you click on your main document part, then the anchor element, you'll get:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
import java.lang.Integer;
import java.lang.Long;
import javax.xml.bind.JAXBElement;
import org.docx4j.dml.CTBlip;
import org.docx4j.dml.CTBlipFillProperties;
import org.docx4j.dml.CTGeomGuideList;
import org.docx4j.dml.CTGraphicalObjectFrameLocking;
import org.docx4j.dml.CTLineProperties;
import org.docx4j.dml.CTNoFillProperties;
import org.docx4j.dml.CTNonVisualDrawingProps;
import org.docx4j.dml.CTNonVisualGraphicFrameProperties;
import org.docx4j.dml.CTNonVisualPictureProperties;
import org.docx4j.dml.CTOfficeArtExtension;
import org.docx4j.dml.CTOfficeArtExtensionList;
import org.docx4j.dml.CTPictureLocking;
import org.docx4j.dml.CTPoint2D;
import org.docx4j.dml.CTPositiveSize2D;
import org.docx4j.dml.CTPresetGeometry2D;
import org.docx4j.dml.CTRelativeRect;
import org.docx4j.dml.CTShapeProperties;
import org.docx4j.dml.CTStretchInfoProperties;
import org.docx4j.dml.CTTransform2D;
import org.docx4j.dml.Graphic;
import org.docx4j.dml.GraphicData;
import org.docx4j.dml.picture.CTPictureNonVisual;
import org.docx4j.dml.picture.Pic;
import org.docx4j.dml.wordprocessingDrawing.Anchor;
import org.docx4j.dml.wordprocessingDrawing.CTEffectExtent;
import org.docx4j.dml.wordprocessingDrawing.CTPosH;
import org.docx4j.dml.wordprocessingDrawing.CTPosV;
import org.docx4j.dml.wordprocessingDrawing.CTWrapPath;
import org.docx4j.dml.wordprocessingDrawing.CTWrapTight;


public class Foo {
public Anchor createIt() {

org.docx4j.dml.wordprocessingDrawing.ObjectFactory dmlwordprocessingDrawingObjectFactory = new org.docx4j.dml.wordprocessingDrawing.ObjectFactory();

Anchor anchor = dmlwordprocessingDrawingObjectFactory.createAnchor();
    // Create object for wrapTight
    CTWrapTight wraptight = dmlwordprocessingDrawingObjectFactory.createCTWrapTight();
    anchor.setWrapTight(wraptight);
        wraptight.setWrapText(org.docx4j.dml.wordprocessingDrawing.STWrapText.BOTH_SIDES);
        // Create object for wrapPolygon
        CTWrapPath wrappath = dmlwordprocessingDrawingObjectFactory.createCTWrapPath();
        wraptight.setWrapPolygon(wrappath);
org.docx4j.dml.ObjectFactory dmlObjectFactory = new org.docx4j.dml.ObjectFactory();
            // Create object for lineTo
            CTPoint2D point2d = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d);
                point2d.setY( 21127 );
                point2d.setX( 0 );
            // Create object for lineTo
            CTPoint2D point2d2 = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d2);
                point2d2.setY( 21127 );
                point2d2.setX( 21413 );
            // Create object for lineTo
            CTPoint2D point2d3 = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d3);
                point2d3.setY( 0 );
                point2d3.setX( 21413 );
            // Create object for lineTo
            CTPoint2D point2d4 = dmlObjectFactory.createCTPoint2D();
            wrappath.getLineTo().add( point2d4);
                point2d4.setY( 0 );
                point2d4.setX( 0 );
            // Create object for start
            CTPoint2D point2d5 = dmlObjectFactory.createCTPoint2D();
            wrappath.setStart(point2d5);
                point2d5.setY( 0 );
                point2d5.setX( 0 );
    // Create object for docPr
    CTNonVisualDrawingProps nonvisualdrawingprops = dmlObjectFactory.createCTNonVisualDrawingProps();
    anchor.setDocPr(nonvisualdrawingprops);
        nonvisualdrawingprops.setDescr( "http://louisianalawblog.wp.lexblogs.com/wp-content/uploads/sites/342/2015/02/app.jpg");
        nonvisualdrawingprops.setName( "Picture 1");
        nonvisualdrawingprops.setId( 1 );
    // Create object for cNvGraphicFramePr
    CTNonVisualGraphicFrameProperties nonvisualgraphicframeproperties = dmlObjectFactory.createCTNonVisualGraphicFrameProperties();
    anchor.setCNvGraphicFramePr(nonvisualgraphicframeproperties);
        // Create object for graphicFrameLocks
        CTGraphicalObjectFrameLocking graphicalobjectframelocking = dmlObjectFactory.createCTGraphicalObjectFrameLocking();
        nonvisualgraphicframeproperties.setGraphicFrameLocks(graphicalobjectframelocking);
    // Create object for graphic
    Graphic graphic = dmlObjectFactory.createGraphic();
    anchor.setGraphic(graphic);
        // Create object for graphicData
        GraphicData graphicdata = dmlObjectFactory.createGraphicData();
        graphic.setGraphicData(graphicdata);
            graphicdata.setUri( "http://schemas.openxmlformats.org/drawingml/2006/picture");
org.docx4j.dml.picture.ObjectFactory dmlpictureObjectFactory = new org.docx4j.dml.picture.ObjectFactory();
            // Create object for pic (wrapped in JAXBElement)
            Pic pic = dmlpictureObjectFactory.createPic();
            JAXBElement<org.docx4j.dml.picture.Pic> picWrapped = dmlpictureObjectFactory.createPic(pic);
            graphicdata.getAny().add( picWrapped);
                // Create object for blipFill
                CTBlipFillProperties blipfillproperties = dmlObjectFactory.createCTBlipFillProperties();
                pic.setBlipFill(blipfillproperties);
                    // Create object for blip
                    CTBlip blip = dmlObjectFactory.createCTBlip();
                    blipfillproperties.setBlip(blip);
                        blip.setEmbed( "rId4");
                        // Create object for extLst
                        CTOfficeArtExtensionList officeartextensionlist = dmlObjectFactory.createCTOfficeArtExtensionList();
                        blip.setExtLst(officeartextensionlist);
                            // Create object for ext
                            CTOfficeArtExtension officeartextension = dmlObjectFactory.createCTOfficeArtExtension();
                            officeartextensionlist.getExt().add( officeartextension);
                                officeartextension.setUri( "{28A0092B-C50C-407E-A947-70E740481C1C}");
                        blip.setCstate(org.docx4j.dml.STBlipCompression.NONE);
                        blip.setLink( "");
                    // Create object for srcRect
                    CTRelativeRect relativerect = dmlObjectFactory.createCTRelativeRect();
                    blipfillproperties.setSrcRect(relativerect);
                        relativerect.setT( new Integer(0) );
                        relativerect.setL( new Integer(0) );
                        relativerect.setR( new Integer(0) );
                        relativerect.setB( new Integer(0) );
                    // Create object for stretch
                    CTStretchInfoProperties stretchinfoproperties = dmlObjectFactory.createCTStretchInfoProperties();
                    blipfillproperties.setStretch(stretchinfoproperties);
                        // Create object for fillRect
                        CTRelativeRect relativerect2 = dmlObjectFactory.createCTRelativeRect();
                        stretchinfoproperties.setFillRect(relativerect2);
                            relativerect2.setT( new Integer(0) );
                            relativerect2.setL( new Integer(0) );
                            relativerect2.setR( new Integer(0) );
                            relativerect2.setB( new Integer(0) );
                // Create object for spPr
                CTShapeProperties shapeproperties = dmlObjectFactory.createCTShapeProperties();
                pic.setSpPr(shapeproperties);
                    // Create object for noFill
                    CTNoFillProperties nofillproperties = dmlObjectFactory.createCTNoFillProperties();
                    shapeproperties.setNoFill(nofillproperties);
                    // Create object for xfrm
                    CTTransform2D transform2d = dmlObjectFactory.createCTTransform2D();
                    shapeproperties.setXfrm(transform2d);
                        // Create object for ext
                        CTPositiveSize2D positivesize2d = dmlObjectFactory.createCTPositiveSize2D();
                        transform2d.setExt(positivesize2d);
                            positivesize2d.setCx( 1903016 );
                            positivesize2d.setCy( 1304925 );
                        transform2d.setRot( new Integer(0) );
                        // Create object for off
                        CTPoint2D point2d6 = dmlObjectFactory.createCTPoint2D();
                        transform2d.setOff(point2d6);
                            point2d6.setY( 0 );
                            point2d6.setX( 0 );
                    // Create object for ln
                    CTLineProperties lineproperties = dmlObjectFactory.createCTLineProperties();
                    shapeproperties.setLn(lineproperties);
                        // Create object for noFill
                        CTNoFillProperties nofillproperties2 = dmlObjectFactory.createCTNoFillProperties();
                        lineproperties.setNoFill(nofillproperties2);
                    shapeproperties.setBwMode(org.docx4j.dml.STBlackWhiteMode.AUTO);
                    // Create object for prstGeom
                    CTPresetGeometry2D presetgeometry2d = dmlObjectFactory.createCTPresetGeometry2D();
                    shapeproperties.setPrstGeom(presetgeometry2d);
                        // Create object for avLst
                        CTGeomGuideList geomguidelist = dmlObjectFactory.createCTGeomGuideList();
                        presetgeometry2d.setAvLst(geomguidelist);
                        presetgeometry2d.setPrst(org.docx4j.dml.STShapeType.RECT);
                // Create object for nvPicPr
                CTPictureNonVisual picturenonvisual = dmlpictureObjectFactory.createCTPictureNonVisual();
                pic.setNvPicPr(picturenonvisual);
                    // Create object for cNvPicPr
                    CTNonVisualPictureProperties nonvisualpictureproperties = dmlObjectFactory.createCTNonVisualPictureProperties();
                    picturenonvisual.setCNvPicPr(nonvisualpictureproperties);
                        // Create object for picLocks
                        CTPictureLocking picturelocking = dmlObjectFactory.createCTPictureLocking();
                        nonvisualpictureproperties.setPicLocks(picturelocking);
                    // Create object for cNvPr
                    CTNonVisualDrawingProps nonvisualdrawingprops2 = dmlObjectFactory.createCTNonVisualDrawingProps();
                    picturenonvisual.setCNvPr(nonvisualdrawingprops2);
                        nonvisualdrawingprops2.setDescr( "http://louisianalawblog.wp.lexblogs.com/wp-content/uploads/sites/342/2015/02/app.jpg");
                        nonvisualdrawingprops2.setName( "Picture 1");
                        nonvisualdrawingprops2.setId( 0 );
    anchor.setDistT( new Long(0) );
    anchor.setDistB( new Long(0) );
    anchor.setDistL( new Long(114300) );
    anchor.setDistR( new Long(114300) );
    anchor.setRelativeHeight( 251658240 );
    // Create object for simplePos
    CTPoint2D point2d7 = dmlObjectFactory.createCTPoint2D();
    anchor.setSimplePos(point2d7);
        point2d7.setY( 0 );
        point2d7.setX( 0 );
    // Create object for positionH
    CTPosH posh = dmlwordprocessingDrawingObjectFactory.createCTPosH();
    anchor.setPositionH(posh);
        posh.setRelativeFrom(org.docx4j.dml.wordprocessingDrawing.STRelFromH.COLUMN);
        posh.setPosOffset( new Integer(4152900) );
    // Create object for positionV
    CTPosV posv = dmlwordprocessingDrawingObjectFactory.createCTPosV();
    anchor.setPositionV(posv);
        posv.setRelativeFrom(org.docx4j.dml.wordprocessingDrawing.STRelFromV.PARAGRAPH);
        posv.setPosOffset( new Integer(0) );
    // Create object for extent
    CTPositiveSize2D positivesize2d2 = dmlObjectFactory.createCTPositiveSize2D();
    anchor.setExtent(positivesize2d2);
        positivesize2d2.setCx( 1903016 );
        positivesize2d2.setCy( 1304925 );
    // Create object for effectExtent
    CTEffectExtent effectextent = dmlwordprocessingDrawingObjectFactory.createCTEffectExtent();
    anchor.setEffectExtent(effectextent);
        effectextent.setT( 0 );
        effectextent.setL( 0 );
        effectextent.setR( 2540 );
        effectextent.setB( 0 );

return anchor;
}
}
 
Parsed in 0.038 seconds, using GeSHi 1.0.8.4


Or you can use:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
String openXML = "<wp:anchor allowOverlap=\"1\" behindDoc=\"1\" distB=\"0\" distL=\"114300\" distR=\"114300\" distT=\"0\" layoutInCell=\"1\" locked=\"0\" relativeHeight=\"251658240\" simplePos=\"0\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">"
            + "<wp:simplePos x=\"0\" y=\"0\"/>"
            + "<wp:positionH relativeFrom=\"column\">"
                + "<wp:posOffset>4152900</wp:posOffset>"
            +"</wp:positionH>"
            + "<wp:positionV relativeFrom=\"paragraph\">"
                + "<wp:posOffset>0</wp:posOffset>"
            +"</wp:positionV>"
            + "<wp:extent cx=\"1903016\" cy=\"1304925\"/>"
            + "<wp:effectExtent b=\"0\" l=\"0\" r=\"2540\" t=\"0\"/>"
            + "<wp:wrapTight wrapText=\"bothSides\">"
                + "<wp:wrapPolygon edited=\"0\">"
                    + "<wp:start x=\"0\" y=\"0\"/>"
                    + "<wp:lineTo x=\"0\" y=\"21127\"/>"
                    + "<wp:lineTo x=\"21413\" y=\"21127\"/>"
                    + "<wp:lineTo x=\"21413\" y=\"0\"/>"
                    + "<wp:lineTo x=\"0\" y=\"0\"/>"
                +"</wp:wrapPolygon>"
            +"</wp:wrapTight>"
            + "<wp:docPr descr=\"http://louisianalawblog.wp.lexblogs.com/wp-content/uploads/sites/342/2015/02/app.jpg\" id=\"1\" name=\"Picture 1\"/>"
            + "<wp:cNvGraphicFramePr>"
                + "<a:graphicFrameLocks noChangeAspect=\"1\"/>"
            +"</wp:cNvGraphicFramePr>"
            + "<a:graphic>"
                + "<a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">"
                    + "<pic:pic>"
                        + "<pic:nvPicPr>"
                            + "<pic:cNvPr descr=\"http://louisianalawblog.wp.lexblogs.com/wp-content/uploads/sites/342/2015/02/app.jpg\" id=\"0\" name=\"Picture 1\"/>"
                            + "<pic:cNvPicPr>"
                                + "<a:picLocks noChangeArrowheads=\"1\" noChangeAspect=\"1\"/>"
                            +"</pic:cNvPicPr>"
                        +"</pic:nvPicPr>"
                        + "<pic:blipFill>"
                            + "<a:blip r:embed=\"rId4\">"
                                + "<a:extLst>"
                                    + "<a:ext uri=\"{28A0092B-C50C-407E-A947-70E740481C1C}\">"
                                        + "<a14:useLocalDpi val=\"0\"/>"
                                    +"</a:ext>"
                                +"</a:extLst>"
                            +"</a:blip>"
                            + "<a:srcRect/>"
                            + "<a:stretch>"
                                + "<a:fillRect/>"
                            +"</a:stretch>"
                        +"</pic:blipFill>"
                        + "<pic:spPr bwMode=\"auto\">"
                            + "<a:xfrm>"
                                + "<a:off x=\"0\" y=\"0\"/>"
                                + "<a:ext cx=\"1903016\" cy=\"1304925\"/>"
                            +"</a:xfrm>"
                            + "<a:prstGeom prst=\"rect\">"
                                + "<a:avLst/>"
                            +"</a:prstGeom>"
                            + "<a:noFill/>"
                            + "<a:ln>"
                                + "<a:noFill/>"
                            +"</a:ln>"
                        +"</pic:spPr>"
                    +"</pic:pic>"
                +"</a:graphicData>"
            +"</a:graphic>"
        +"</wp:anchor>";
Anchor anchor = (Anchor)XmlUtils.unmarshalString(openXML);
 
Parsed in 0.024 seconds, using GeSHi 1.0.8.4