/** * Get the PictureData of the Picture, if present. * Note - not all kinds of picture have data */ public XWPFPictureData GetPictureData() { //String blipId = ctPic.blipFill.blip.embed; CT_BlipFillProperties blipProps = ctPic.blipFill; if (blipProps == null || !blipProps.IsSetBlip()) { // return null if Blip data is missing return(null); } String blipId = blipProps.blip.embed; POIXMLDocumentPart part = run.GetParagraph().GetPart(); if (part != null) { POIXMLDocumentPart relatedPart = part.GetRelationById(blipId); if (relatedPart is XWPFPictureData) { return((XWPFPictureData)relatedPart); } } return(null); }
/** * Get the PictureData of the Picture, if present. * Note - not all kinds of picture have data */ public XWPFPictureData GetPictureData() { String blipId = ctPic.blipFill.blip.embed; POIXMLDocumentPart part = run.GetParagraph().GetPart(); if (part != null) { POIXMLDocumentPart relatedPart = part.GetRelationById(blipId); if (relatedPart is XWPFPictureData) { return((XWPFPictureData)relatedPart); } } return(null); }