本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFDocument.addPictureData()
方法的一些代码示例,展示了XWPFDocument.addPictureData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWPFDocument.addPictureData()
方法的具体详情如下:
包路径:org.apache.poi.xwpf.usermodel.XWPFDocument
类名称:XWPFDocument
方法名:addPictureData
暂无
代码示例来源:origin: org.apache.poi/poi-ooxml
public String addPictureData(InputStream is, int format) throws InvalidFormatException {
try {
byte[] data = IOUtils.toByteArray(is);
return addPictureData(data, format);
} catch (IOException e) {
throw new POIXMLException(e);
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@SuppressWarnings("resource")
XWPFDocument doc = parent.getDocument();
relationId = doc.addPictureData(pictureData, pictureType);
picData = (XWPFPictureData) doc.getRelationById(relationId);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
public String addPictureData(InputStream is, int format) throws InvalidFormatException {
try {
byte[] data = IOUtils.toByteArray(is);
return addPictureData(data, format);
} catch (IOException e) {
throw new POIXMLException(e);
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public String addPictureData(InputStream is,int format) throws InvalidFormatException
{
try {
byte[] data = IOUtils.toByteArray(is);
return addPictureData(data, format);
} catch (IOException e) {
throw new POIXMLException(e);
}
}
代码示例来源:origin: org.jeecg/easypoi-base
/**
* 添加图片
*
* @author JueYue
* 2013-11-20
* @param obj
* @param currentRun
* @throws Exception
*/
private void addAnImage(WordImageEntity obj, XWPFRun currentRun) throws Exception {
Object[] isAndType = PoiPublicUtil.getIsAndType(obj);
String picId;
try {
picId = currentRun.getDocument().addPictureData((byte[]) isAndType[0],
(Integer) isAndType[1]);
((MyXWPFDocument) currentRun.getDocument()).createPicture(currentRun,
picId, currentRun.getDocument()
.getNextPicNameNumber((Integer) isAndType[1]),
obj.getWidth(), obj.getHeight());
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
}
代码示例来源:origin: cn.afterturn/easypoi-base
/**
* 添加图片
*
* @author JueYue
* 2013-11-20
* @param obj
* @param currentRun
* @throws Exception
*/
private void addAnImage(ImageEntity obj, XWPFRun currentRun) throws Exception {
Object[] isAndType = PoiPublicUtil.getIsAndType(obj);
String picId;
try {
picId = currentRun.getDocument().addPictureData((byte[]) isAndType[0],
(Integer) isAndType[1]);
((MyXWPFDocument) currentRun.getDocument()).createPicture(currentRun,
picId, currentRun.getDocument()
.getNextPicNameNumber((Integer) isAndType[1]),
obj.getWidth(), obj.getHeight());
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
}
代码示例来源:origin: zhangdaiscott/jeasypoi
/**
* 添加图片
*
* @Author JueYue
* @date 2013-11-20
* @param obj
* @param currentRun
* @throws Exception
*/
private void addAnImage(WordImageEntity obj, XWPFRun currentRun) throws Exception {
Object[] isAndType = PoiPublicUtil.getIsAndType(obj);
String picId;
try {
picId = currentRun.getParagraph().getDocument().addPictureData((byte[]) isAndType[0], (Integer) isAndType[1]);
((MyXWPFDocument) currentRun.getParagraph().getDocument()).createPicture(currentRun, picId, currentRun.getParagraph().getDocument().getNextPicNameNumber((Integer) isAndType[1]), obj.getWidth(), obj.getHeight());
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
}
代码示例来源:origin: xiaolanglang/easypoi
/**
* 添加图片
*
* @Author JueYue
* @date 2013-11-20
* @param obj
* @param currentRun
* @throws Exception
*/
private void addAnImage(WordImageEntity obj, XWPFRun currentRun) throws Exception {
Object[] isAndType = PoiPublicUtil.getIsAndType(obj);
String picId;
try {
picId = currentRun.getParagraph().getDocument()
.addPictureData((byte[]) isAndType[0], (Integer) isAndType[1]);
((MyXWPFDocument) currentRun.getParagraph().getDocument()).createPicture(currentRun,
picId,
currentRun.getParagraph().getDocument()
.getNextPicNameNumber((Integer) isAndType[1]), obj.getWidth(), obj.getHeight());
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@SuppressWarnings("resource")
XWPFDocument doc = parent.getDocument();
relationId = doc.addPictureData(pictureData, pictureType);
picData = (XWPFPictureData) doc.getRelationById(relationId);
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
String relationId = doc.addPictureData(pictureData, pictureType);
XWPFPictureData picData = (XWPFPictureData) doc.getRelationById(relationId);
内容来源于网络,如有侵权,请联系作者删除!