Package org.docx4j.dml

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


          && 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

          || 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

    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

    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

TOP

Related Classes of org.docx4j.dml.CTBlip

Copyright © 2018 www.massapicom. 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.