String imageUrl = imgElement.attribute(new QName("src")).getValue();
InputStream is = null;
try{
is = new FileInputStream("E:\\Midea-MPM\\image\\279400860.wmf");
byte[] bytes = IOUtils.toByteArray(is);
int pictureIdx = workbook.addPicture(bytes, workbook.PICTURE_TYPE_WMF);
// 图片插入坐标
anchor.setCol1(readColNo);
anchor.setRow1(tr_idx);
anchor.setCol2(readColNo + colspan - 1);
anchor.setRow2(rowspan + tr_idx - 1);
// 插入图片
HSSFPicture pict = drawingPatriarch.createPicture(anchor, pictureIdx);
pict.resize();
}catch(Exception e){
throw e;
}finally{
if(is != null){
is.close();
is = null;
}
}
POI HTML2 Excel 插入WMF格式图片 显示文件损坏. 请大神指导 !!!!急 ~~~
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
悬赏问题
- ¥15 程序不包含适用于入口点的静态Main方法
- ¥15 素材场景中光线烘焙后灯光失效
- ¥15 请教一下各位,为什么我这个没有实现模拟点击
- ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
- ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
- ¥20 有关区间dp的问题求解
- ¥15 多电路系统共用电源的串扰问题
- ¥15 slam rangenet++配置
- ¥15 有没有研究水声通信方面的帮我改俩matlab代码
- ¥15 ubuntu子系统密码忘记