以编程方式将多个jpeg图像嵌入EXCEL? [英] Embed multiple jpeg images into EXCEL programmatically?

查看:109
本文介绍了以编程方式将多个jpeg图像嵌入EXCEL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的Stackoverflowers,



输出带有图像的Excel电子表格是我正在做的一个项目的要求。我做了一些研究,发现以下(可能是不正确的)共识:




  • 各种用于创建excel表的python库工作良好

  • 可以插入图像(但仅在bmp中)

  • 在Excel文件中使用的图像的内部格式是复杂的,可能是为什么没有第三方库支持插入普通格式,如jpeg。



我不想使用或转换为bmp。为什么? BMP不能很好地压缩,这些将是大的表,所以我想要尽可能地减轻图像的大小影响(每行1个)。



我的理想答案来自实际做到这一点的人。建议的方法可以是Java,Ruby,Python(但不是.NET)或其他创造性的方法。



我真的希望有人有一个解决方案,因为我预计这可能是一个棘手的区域(也许与复杂的PDF相似) / p>

解决方案

正如上面的评论所述, Apache POI Excel插入图像


Dear Stackoverflowers,

Outputting an Excel spreadsheet with images is a requirement of a project I'm doing. I've done a little research and found the following (perhaps incorrect) consensus :

  • various python libs for creating excels sheets work well
  • it is possible to insert images (but only in bmp)
  • the "internal format" of images used in excel files, is complicated, which may be why there is no 3rd party library support for inserting normal formats like jpeg.

I don't want to use or convert to bmp. Why? BMP are not compressed well, and these will be big sheets, so I want to mitigate the size impact of images (1 per row) as much as possible.

My ideal answer comes from someone who has actually done this. The method suggested can be in Java,Ruby,Python,(but not .NET) or some other creative way of doing it.

I'm really hoping someone out there has a solution, as I anticipate this could be a tricky area (similar in complexity to playing around with PDFs, perhaps).

解决方案

As said in the comment above, Apache POI can solve your problem.

I did a little research and this example should be useful Apache POI Excel Insert an Image

这篇关于以编程方式将多个jpeg图像嵌入EXCEL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆