When rendering an Excel sheet/cell to an image. I noticed a single word was divided which was inconsistent with the manual Copy/Paste in Office.
var workbook = new Workbook(@“test.xlsx”);
var options = new ImageOrPrintOptions
ImageFormat = ImageFormat.Emf,
OnlyArea = false,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true,
Transparent = true
var sheet = workbook.Worksheets;
sheet.PageSetup.PrintArea = "A1:A1"; sheet.PageSetup.Zoom = 100; sheet.PageSetup.LeftMargin = sheet.PageSetup.RightMargin = sheet.PageSetup.TopMargin = sheet.PageSetup.BottomMargin = sheet.PageSetup.HeaderMargin = sheet.PageSetup.FooterMargin = 0; SheetRender render = new SheetRender(sheet, options); render.ToImage(0, @"out.emf");
I have done some investigation myself and noticed the issue might come from that I font for each individual character in the cell. The reason for that was because in practice I need to set different font for different characters in a single cell, however the output image has become inconsistent with the Office behaviour because of this. Could you please look into this?