Adding images into Excel using EPPlus

I’m not sure if this is the best solution but definetly a workaround for your problem.

Here’s what I did:

ExcelPackage package = new ExcelPackage();
var ws = package.Workbook.Worksheets.Add("Test Page");

for (int a = 0; a < 5; a++)
{
    ws.Row(a * 5).Height = 39.00D;
}

for (int a = 0; a < 5; a++)
{
    var picture = ws.Drawings.AddPicture(a.ToString(), logo);
    picture.SetPosition(a * 5, 0, 2, 0);
}

Here is how it looks.

enter image description here

For some reason when we have the row height set, its interfering with the picture height.

Leave a Comment