Examples of CTBlip


Examples of org.docx4j.dml.CTBlip

          || pic.getBlipFill().getBlip()==null) {
        log.error("blip missing!!");
        return null;               
      }
     
      CTBlip blip = pic.getBlipFill().getBlip();
     
      String imgRelId = blip.getEmbed();
      if ((imgRelId == null) || (imgRelId.length() == 0)) {
        imgRelId = blip.getLink();
      }
      if ((imgRelId != null) && (imgRelId.length() > 0)) {
        converter.handleImageRel(imageHandler, imgRelId, sourcePart);
      }
      else {
View Full Code Here

Examples of org.docx4j.dml.CTBlip

          && imgPt.getSpPr()!=null
          && imgPt.getSpPr().getBlipFill()!=null
          && imgPt.getSpPr().getBlipFill().getBlip()!=null) {
       
        // Get the relId
        CTBlip blip = imgPt.getSpPr().getBlipFill().getBlip();       
        if (blip.getEmbed()!=null) {
         
          String relId = blip.getEmbed();
          //Relationship r = diagramDataPart.getRelationshipsPart().getRelationshipByID(relId);
          BinaryPartAbstractImage bpai = (BinaryPartAbstractImage)diagramDataPart.getRelationshipsPart().getPart(relId);

          // Add it
          Image image = factory.createSmartArtDataHierarchyImagesImage();
          image.setContentType(bpai.getContentType());
          image.setId(imgPt.getModelId());
         
          image.setValue(bpai.getBytes());
         
          images.getImage().add(image);
         
          // reference
          org.opendope.SmartArt.dataHierarchy.ImageRef imageRef = factory.createImageRef();
          imageRef.setContentRef(imgPt.getModelId());
          // Other attributes
          if (imgPt.getPrSet()!=null ) {
            CTElemPropSet props = imgPt.getPrSet();
            if (props.getCustLinFactNeighborX()!=null) {
              imageRef.setCustLinFactNeighborX(props.getCustLinFactNeighborX());
            }
            if (props.getCustLinFactNeighborY()!=null) {
              imageRef.setCustLinFactNeighborY(props.getCustLinFactNeighborY());
            }
            if (props.getCustScaleX()!=null) {
              imageRef.setCustScaleX(props.getCustScaleX());
            }
            if (props.getCustScaleY()!=null) {
              imageRef.setCustScaleY(props.getCustScaleY());
            }
          }
         
          thisListItem.setImageRef(imageRef);
         
        } else if  (blip.getLink()!=null) {
          // TODO
          // -check a linked image actually works in SmartArt.
          // -our export format could be extended to support linked images
          // -and/or we could fetch the image and embed it
         
View Full Code Here

Examples of org.docx4j.dml.CTBlip

          || converter.pic.getBlipFill().getBlip()==null) {
        log.error("blip missing!!");
        return null;               
      }
     
      CTBlip blip = converter.pic.getBlipFill().getBlip();
     
      String imgRelId = blip.getEmbed();     
      if (imgRelId!=null) {
        converter.handleImageRel(context.getImageHandler(), imgRelId,
            (Part)context.getResolvedLayout().relationships.getSourceP());
      } else if (blip.getLink()!=null) {
        converter.handleImageRel(context.getImageHandler(), blip.getLink(),
            (Part)context.getResolvedLayout().relationships.getSourceP());
      } else {
        log.error("not linked or embedded?!");
      }
View Full Code Here

Examples of org.docx4j.dml.CTBlip

    org.docx4j.dml.ObjectFactory dmlObjectFactory = new org.docx4j.dml.ObjectFactory();
                // Create object for blipFill
                CTBlipFillProperties blipfillproperties = dmlObjectFactory.createCTBlipFillProperties();
                picture.setBlipFill(blipfillproperties);
                    // Create object for blip
                    CTBlip blip = dmlObjectFactory.createCTBlip();
                    blipfillproperties.setBlip(blip);
                        blip.setCstate(org.docx4j.dml.STBlipCompression.NONE);
                        blip.setEmbed( imageRelID );
                        // 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.setLink( "");
                    // Create object for stretch
                    CTStretchInfoProperties stretchinfoproperties = dmlObjectFactory.createCTStretchInfoProperties();
                    blipfillproperties.setStretch(stretchinfoproperties);
                        // Create object for fillRect
                        CTRelativeRect relativerect = dmlObjectFactory.createCTRelativeRect();
View Full Code Here

Examples of org.docx4j.dml.CTBlip

    org.docx4j.dml.ObjectFactory dmlObjectFactory = new org.docx4j.dml.ObjectFactory();
                // Create object for blipFill
                CTBlipFillProperties blipfillproperties = dmlObjectFactory.createCTBlipFillProperties();
                picture.setBlipFill(blipfillproperties);
                    // Create object for blip
                    CTBlip blip = dmlObjectFactory.createCTBlip();
                    blipfillproperties.setBlip(blip);
                        blip.setCstate(org.docx4j.dml.STBlipCompression.NONE);
                        blip.setEmbed( imageRelID );
                        // 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.setLink( "");
                    // Create object for stretch
                    CTStretchInfoProperties stretchinfoproperties = dmlObjectFactory.createCTStretchInfoProperties();
                    blipfillproperties.setStretch(stretchinfoproperties);
                        // Create object for fillRect
                        CTRelativeRect relativerect = dmlObjectFactory.createCTRelativeRect();
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTBlip

         
          CTNonVisualPictureProperties cNvPicPr = nvPicPr.addNewCNvPicPr();
          cNvPicPr.addNewPicLocks().setNoChangeAspect(true);
         
          CTBlipFillProperties blipFill = pic.addNewBlipFill();
          CTBlip blip = blipFill.addNewBlip();
          blip.setEmbed( picData.getPackageRelationship().getId() );
          blipFill.addNewStretch().addNewFillRect();
         
          CTShapeProperties spPr = pic.addNewSpPr();
          CTTransform2D xfrm = spPr.addNewXfrm();
         
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTBlip

            CTNonVisualPictureProperties cNvPicPr = nvPicPr.addNewCNvPicPr();
            cNvPicPr.addNewPicLocks().setNoChangeAspect(true);

            CTBlipFillProperties blipFill = pic.addNewBlipFill();
            CTBlip blip = blipFill.addNewBlip();
            blip.setEmbed( picData.getPackageRelationship().getId() );
            blipFill.addNewStretch().addNewFillRect();

            CTShapeProperties spPr = pic.addNewSpPr();
            CTTransform2D xfrm = spPr.addNewXfrm();
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTBlip

        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);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTBlip

        XSLFPictureShape p = (XSLFPictureShape)sh;
        String blipId = p.getBlipId();
        String relId = getSheet().importBlip(blipId, p.getSheet().getPackagePart());

        CTPicture ct = (CTPicture)getXmlObject();
        CTBlip blip = ct.getBlipFill().getBlip();
        blip.setEmbed(relId);

        CTApplicationNonVisualDrawingProps nvPr = ct.getNvPicPr().getNvPr();
        if(nvPr.isSetCustDataLst()) {
            // discard any custom tags associated with the picture being copied
            nvPr.unsetCustDataLst();
        }
        if(blip.isSetExtLst()) {

            CTOfficeArtExtensionList extLst = blip.getExtLst();
            for(CTOfficeArtExtension ext : extLst.getExtList()){
                String xpath = "declare namespace a14='http://schemas.microsoft.com/office/drawing/2010/main' $this//a14:imgProps/a14:imgLayer";
                XmlObject[] obj = ext.selectPath(xpath);
                if(obj != null && obj.length == 1){
                    XmlCursor c = obj[0].newCursor();
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTBlip

            CTNonVisualPictureProperties cNvPicPr = nvPicPr.addNewCNvPicPr();
            cNvPicPr.addNewPicLocks().setNoChangeAspect(true);

            CTBlipFillProperties blipFill = pic.addNewBlipFill();
            CTBlip blip = blipFill.addNewBlip();
            blip.setEmbed( picData.getPackageRelationship().getId() );
            blipFill.addNewStretch().addNewFillRect();

            CTShapeProperties spPr = pic.addNewSpPr();
            CTTransform2D xfrm = spPr.addNewXfrm();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.