protected String getBlipId(){ String id = getBlip().getEmbed(); if (id.isEmpty()) { return null; } return id; }
@SuppressWarnings("WeakerAccess") protected String getBlipId(){ CTBlip blip = getBlip(); if (blip != null) { String id = blip.getEmbed(); return (id.isEmpty()) ? null : id; } else { return null; } }
private PackagePart getPart() { try { String blipId = blip.getEmbed(); PackageRelationship rel = parentPart.getRelationship(blipId); return parentPart.getRelatedPart(rel); } catch (InvalidFormatException e) { throw new RuntimeException(e); } }
/** * Return picture data for this shape * * @return picture data for this shape */ public XSSFPictureData getPictureData() { String blipId = ctPicture.getBlipFill().getBlip().getEmbed(); return (XSSFPictureData)getDrawing().getRelationById(blipId); }
/** * Get the PictureData of the Picture, if present. * Note - not all kinds of picture have data */ public XWPFPictureData getPictureData() { CTBlipFillProperties blipProps = ctPic.getBlipFill(); if (blipProps == null || !blipProps.isSetBlip()) { // return null if Blip data is missing return null; } String blipId = blipProps.getBlip().getEmbed(); POIXMLDocumentPart part = run.getParent().getPart(); if (part != null) { POIXMLDocumentPart relatedPart = part.getRelationById(blipId); if (relatedPart instanceof XWPFPictureData) { return (XWPFPictureData) relatedPart; } } return null; }
@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; }
if(fp != null && fp.isSetBlipFill()){ CTBlip blip = fp.getBlipFill().getBlip(); String blipId = blip.getEmbed();
CTPicture ctPic = ((CTPicture) sh.getXmlObject()); if (ctPic.getBlipFill() != null && ctPic.getBlipFill().getBlip() != null) { String relID = ctPic.getBlipFill().getBlip().getEmbed(); if (relID != null) { if (slideDesc != null) {
protected String getBlipId(){ String id = getBlip().getEmbed(); if (id.isEmpty()) { return null; } return id; }
@SuppressWarnings("WeakerAccess") protected String getBlipId(){ CTBlip blip = getBlip(); if (blip != null) { String id = blip.getEmbed(); return (id.isEmpty()) ? null : id; } else { return null; } }
private PackagePart getPart() { try { String blipId = blip.getEmbed(); PackageRelationship rel = parentPart.getRelationship(blipId); return parentPart.getRelatedPart(rel); } catch (InvalidFormatException e) { throw new RuntimeException(e); } }
/** * Returns the picture data of the given picture. * * @param picture * @return */ public XWPFPictureData getPictureData( CTPicture picture ) { String blipId = picture.getBlipFill().getBlip().getEmbed(); return getPictureDataByID( blipId ); }
/** * Returns the picture data of the given picture. * * @param picture * @return */ public XWPFPictureData getPictureData( CTPicture picture ) { String blipId = picture.getBlipFill().getBlip().getEmbed(); return getPictureDataByID( blipId ); }
/** * Returns the picture data of the given picture. * * @param picture * @return */ public XWPFPictureData getPictureData( CTPicture picture ) { String blipId = picture.getBlipFill().getBlip().getEmbed(); return getPictureDataByID( blipId ); }
private String getBlipId(){ CTPicture ct = (CTPicture)getXmlObject(); return ct.getBlipFill().getBlip().getEmbed(); }
/** * Return picture data for this shape * * @return picture data for this shape */ public XSSFPictureData getPictureData() { String blipId = ctPicture.getBlipFill().getBlip().getEmbed(); return (XSSFPictureData)getDrawing().getRelationById(blipId); }
/** * Return picture data for this shape * * @return picture data for this shape */ public XSSFPictureData getPictureData() { String blipId = ctPicture.getBlipFill().getBlip().getEmbed(); for (POIXMLDocumentPart part : getDrawing().getRelations()) { if(part.getPackageRelationship().getId().equals(blipId)){ return (XSSFPictureData)part; } } logger.log(POILogger.WARN, "Picture data was not found for blipId=" + blipId); return null; }
public byte[] getPictureBytes( CTPicture picture ) throws Exception { CTBlipFillProperties blipProps = picture.getBlipFill(); if ( blipProps == null || !blipProps.isSetBlip() ) { // return null if Blip data is missing return null; } String blipId = blipProps.getBlip().getEmbed(); InputStream in = provider.getInputStreamByRelId( getPartRelIdParsing(), blipId ); if ( in == null ) { return null; } return IOUtils.toByteArray( in ); }
public byte[] getPictureBytes( CTPicture picture ) throws Exception { CTBlipFillProperties blipProps = picture.getBlipFill(); if ( blipProps == null || !blipProps.isSetBlip() ) { // return null if Blip data is missing return null; } String blipId = blipProps.getBlip().getEmbed(); InputStream in = provider.getInputStreamByRelId( getPartRelIdParsing(), blipId ); if ( in == null ) { return null; } return IOUtils.toByteArray( in ); }
@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; }