I am using the code below to export a range to the html file.
I have an image in the first cell of the range and the cell alignment is set to left.
I am seeing the image correctly in Excel (see attached), but in HTML the image could not be fully seen.
using (var fstream = new FileStream(dataDir + "TestExport.xlsx", FileMode.Open))
{
// Instantiate a Workbook object that represents the existing Excel file
var workbook = new Workbook(fstream);
var sheet = workbook.Worksheets["Sheet1"];
workbook.Worksheets.ActiveSheetIndex = sheet.Index;
var range = workbook.Worksheets.GetRangeByName("SOME_RANGE");
sheet.PageSetup.PrintArea = range.Address;
// Save the Excel file
workbook.Save(dataDir + "1.html", new HtmlSaveOptions
{
ExportImagesAsBase64 = true,
ExportPrintAreaOnly = true,
ExportHiddenWorksheet = false,
ExportActiveWorksheetOnly = true
});
}
align_issue.zip (19.2 KB)