/** * Link Picture with PictureData * * @param rel */ public void setPictureReference(PackageRelationship rel) { ctPic.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Link this shape with the picture data * * @param rel relationship referring the picture data */ protected void setPictureReference(PackageRelationship rel){ ctPicture.getBlipFill().getBlip().setEmbed(rel.getId()); }
blip.setEmbed(relId);
blip.setEmbed(parent.getPart().getRelationId(picData)); blipFill.addNewStretch().addNewFillRect();
blip.setEmbed(relId);
/** * @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); 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; }
blip.addNewBlip().setEmbed(""); blip.addNewStretch().addNewFillRect();
blip.addNewBlip().setEmbed(picRel); blip.addNewStretch().addNewFillRect();
blipFill.addNewBlip().setEmbed(imgDrawPR.getId()); blipFill.addNewStretch().addNewFillRect();
@Override public XSLFSlide importContent(XSLFSheet src){ super.importContent(src); if (!(src instanceof XSLFSlide)) { return this; } // only copy direct backgrounds - not backgrounds of master sheet CTBackground bgOther = ((XSLFSlide)src)._slide.getCSld().getBg(); if (bgOther == null) { return this; } CTBackground bgThis = _slide.getCSld().getBg(); // remove existing background if (bgThis != null) { if (bgThis.isSetBgPr() && bgThis.getBgPr().isSetBlipFill()) { String oldId = bgThis.getBgPr().getBlipFill().getBlip().getEmbed(); removeRelation(oldId); } _slide.getCSld().unsetBg(); } bgThis = (CTBackground)_slide.getCSld().addNewBg().set(bgOther); if(bgOther.isSetBgPr() && bgOther.getBgPr().isSetBlipFill()){ String idOther = bgOther.getBgPr().getBlipFill().getBlip().getEmbed(); String idThis = importBlip(idOther, src); bgThis.getBgPr().getBlipFill().getBlip().setEmbed(idThis); } return this; }
/** * Link this shape with the picture data * * @param rel relationship referring the picture data */ protected void setPictureReference(PackageRelationship rel){ ctPicture.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Link Picture with PictureData * @param rel */ public void setPictureReference(PackageRelationship rel){ ctPic.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Link Picture with PictureData * * @param rel */ public void setPictureReference(PackageRelationship rel) { ctPic.getBlipFill().getBlip().setEmbed(rel.getId()); }
/** * Link this shape with the picture data * * @param rel relationship referring the picture data */ protected void setPictureReference(PackageRelationship rel){ ctPicture.getBlipFill().getBlip().setEmbed(rel.getId()); }
@Override public XSLFSlide importContent(XSLFSheet src){ super.importContent(src); XSLFBackground bgShape = getBackground(); if(bgShape != null) { CTBackground bg = (CTBackground)bgShape.getXmlObject(); if(bg.isSetBgPr() && bg.getBgPr().isSetBlipFill()){ CTBlip blip = bg.getBgPr().getBlipFill().getBlip(); String blipId = blip.getEmbed(); String relId = importBlip(blipId, src.getPackagePart()); blip.setEmbed(relId); } } return this; }
@Override void copy(XSLFShape sh){ super.copy(sh); 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(); } } }
/** * @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); 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; }
/** * @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; }
blip.addNewBlip().setEmbed(""); blip.addNewStretch().addNewFillRect();
@Override public XSLFSlide importContent(XSLFSheet src){ super.importContent(src); if (!(src instanceof XSLFSlide)) { return this; } // only copy direct backgrounds - not backgrounds of master sheet CTBackground bgOther = ((XSLFSlide)src)._slide.getCSld().getBg(); if (bgOther == null) { return this; } CTBackground bgThis = _slide.getCSld().getBg(); // remove existing background if (bgThis != null) { if (bgThis.isSetBgPr() && bgThis.getBgPr().isSetBlipFill()) { String oldId = bgThis.getBgPr().getBlipFill().getBlip().getEmbed(); removeRelation(oldId); } _slide.getCSld().unsetBg(); } bgThis = (CTBackground)_slide.getCSld().addNewBg().set(bgOther); if(bgOther.isSetBgPr() && bgOther.getBgPr().isSetBlipFill()){ String idOther = bgOther.getBgPr().getBlipFill().getBlip().getEmbed(); String idThis = importBlip(idOther, src); bgThis.getBgPr().getBlipFill().getBlip().setEmbed(idThis); } return this; }