dhatim / fastexcel

Generate and read big Excel files quickly
Other
647 stars 116 forks source link

Support for embedding image into a cell #339

Open elemerz opened 9 months ago

elemerz commented 9 months ago

02-Shield.xlsx It would be very nice to add a new feature to embed an image into an xlsx file which does NOT float over the worksheet, but it is tied inside a cell, it moves/grows with the cell. I know we can link an external image via the =IMAGE("https://some-image-host.com/sample-image.png"), but this would be an external link, and sometimes that's not a good solution... See my attached 02-Shield.xlsx file containing such an embedded png file in a cell.

Edsuns commented 3 months ago

Hi. I use =IMAGE to embed an ext image, but failed.

Here is my code:

            Worksheet ws = wb.newWorksheet("AllCallChains");
            ws.formula(0, 0, "=IMAGE(\"https://some-image-host.com/sample-image.png\")");

and the result xlsx file looks: image

There is a @ before IMAGE, and the formula can't be recognized. Do you have any solutions? Thanks!