Hi,
When I set the cells in the excel sheet as ‘Shrink to fit’, I noticed the text became smaller than normal in the rendered image (even if the text doesn’t really need shrink and the text size is normal if copy&paste manually)
Code:
var workbook = new Workbook(@"test.xlsx");
var options = new ImageOrPrintOptions
{
ImageFormat = ImageFormat.Emf,
OnlyArea = false,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true
};
var sheet = workbook.Worksheets[0];
sheet.PageSetup.PrintArea = "B6:I15";
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’ve attached some screenshots and the test files for your reference, could you please look into this?
Thanks
image.png (30.7 KB)image.png (20.7 KB)
comparison.zip (33.2 KB)