Search in sources :

Example 11 with CTPicture

use of org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture in project poi by apache.

the class XSLFPictureShape method prototype.

/**
     * @param shapeId 1-based shapeId
     * @param rel     relationship to the picture data in the ooxml package
     */
static CTPicture prototype(int shapeId, String rel) {
    CTPicture ct = CTPicture.Factory.newInstance();
    CTPictureNonVisual nvSpPr = ct.addNewNvPicPr();
    CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr();
    cnv.setName("Picture " + shapeId);
    cnv.setId(shapeId + 1);
    nvSpPr.addNewCNvPicPr().addNewPicLocks().setNoChangeAspect(true);
    nvSpPr.addNewNvPr();
    CTBlipFillProperties blipFill = ct.addNewBlipFill();
    CTBlip blip = blipFill.addNewBlip();
    blip.setEmbed(rel);
    blipFill.addNewStretch().addNewFillRect();
    CTShapeProperties spPr = ct.addNewSpPr();
    CTPresetGeometry2D prst = spPr.addNewPrstGeom();
    prst.setPrst(STShapeType.RECT);
    prst.addNewAvLst();
    return ct;
}
Also used : CTBlipFillProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties) CTShapeProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties) CTBlip(org.openxmlformats.schemas.drawingml.x2006.main.CTBlip) CTPresetGeometry2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D) CTNonVisualDrawingProps(org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps) CTPicture(org.openxmlformats.schemas.presentationml.x2006.main.CTPicture) CTPictureNonVisual(org.openxmlformats.schemas.presentationml.x2006.main.CTPictureNonVisual)

Aggregations

CTBlipFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties)5 XmlException (org.apache.xmlbeans.XmlException)4 XmlObject (org.apache.xmlbeans.XmlObject)4 CTBlip (org.openxmlformats.schemas.drawingml.x2006.main.CTBlip)4 CTPicture (org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture)4 CTPicture (org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture)4 CTNonVisualDrawingProps (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps)3 CTPresetGeometry2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D)3 CTShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties)3 CTPicture (org.openxmlformats.schemas.presentationml.x2006.main.CTPicture)3 PackageRelationship (org.apache.poi.openxml4j.opc.PackageRelationship)2 XmlCursor (org.apache.xmlbeans.XmlCursor)2 XmlAnyTypeImpl (org.apache.xmlbeans.impl.values.XmlAnyTypeImpl)2 Test (org.junit.Test)2 CTNonVisualPictureProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualPictureProperties)2 CTPoint2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D)2 CTPositiveSize2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)2 CTTransform2D (org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 StringReader (java.io.StringReader)1