This is looking good. Thanks for the update.
Thank you for the confirmation. We will update here when the official version 25.4 is available for you.
Hi, please take a look at the screenshots in this folder. Things highlighted in yellow are issues that have been reported previously and tickets for the same have been created and are open. The things highlighted in red are new issues I’ve noticed. I’ve mentioned the worksheet name and range of the corresponding charts in each of the screenshots.
Brief explanation of the issues:
- Font kerning seems to be off in every instance of aspose when compared to excel. Often times certain alphabets are rendered so close to each other that they’re difficult to read.
- In texts or titles that have underlines, the underlines are breaking. Not sure why this is happening. An observation is that this breaking of underlines happen when smoothing mode property is set to 2D high quality.
Test_03242025.zip (3.4 MB)
Thanks for the template Excel file and screenshots.
I tested your scenario/case using your template Excel file and following sample code. I could not find your mentioned (both) issues.
e.g.,
Sample code:
Workbook workbook = new Workbook("e:\\test2\\Chart_Template.xlsm");
// Access the worksheet
//Worksheet worksheet = workbook.Worksheets["Demographics"];
Worksheet worksheet = workbook.Worksheets["Summary"];
// Set the print area with your desired range in the worksheet
//worksheet.PageSetup.PrintArea = "D273:O305";
worksheet.PageSetup.PrintArea = "T4:AH33";
worksheet.PageSetup.LeftMargin = 0;
worksheet.PageSetup.RightMargin = 0;
worksheet.PageSetup.TopMargin = 0;
worksheet.PageSetup.BottomMargin = 0;
// Clear any header/footer as they'll be captured when converting the worksheet to image
worksheet.PageSetup.ClearHeaderFooter();
// Set OnePagePerSheet option as true
ImageOrPrintOptions options = new ImageOrPrintOptions()
{
OnePagePerSheet = true,
ImageType = Aspose.Cells.Drawing.ImageType.OfficeCompatibleEmf,
HorizontalResolution = 300,
VerticalResolution = 300,
OnlyArea = true,
SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
};
// Take the image of your worksheet
SheetRender sr = new SheetRender(worksheet, options);
//sr.ToImage(0, "e:\\test2\\fontkerning1.jpg");
sr.ToImage(0, "e:\\test2\\underline1.jpg");
Please find attached both output image files for your reference.
files1.zip (50.5 KB)
Do you see any issue with the attached files, please give us details? Also, share your code snippet to reproduce the issue on our end, we will check it soon.
Using the code you shared, I’ve created a few screenshots and highlighted the issue.
The png file named underline1 uses Horizontal and Vertical resolution of 300.
The png file named fontkerning1 uses Horizontal and Vertical resolution of 100 as this is what I use in my application.
Output.zip (306.2 KB)
Please try with the following code snippet:
Workbook workbook = new Workbook("e:\\test2\\Chart_Template.xlsm");
// Access the worksheet
//Worksheet worksheet = workbook.Worksheets["Demographics"];
Worksheet worksheet = workbook.Worksheets["Summary"];
// Set the print area with your desired range in the worksheet
//worksheet.PageSetup.PrintArea = "D273:O305";
worksheet.PageSetup.PrintArea = "T4:AH33";
worksheet.PageSetup.LeftMargin = 0;
worksheet.PageSetup.RightMargin = 0;
worksheet.PageSetup.TopMargin = 0;
worksheet.PageSetup.BottomMargin = 0;
// Clear any header/footer as they'll be captured when converting the worksheet to image
worksheet.PageSetup.ClearHeaderFooter();
// Set OnePagePerSheet option as true
ImageOrPrintOptions options = new ImageOrPrintOptions()
{
OnePagePerSheet = true,
ImageType = Aspose.Cells.Drawing.ImageType.OfficeCompatibleEmf,
HorizontalResolution = 100,
VerticalResolution = 100,
OnlyArea = true,
SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
};
// Take the image of your worksheet
SheetRender sr = new SheetRender(worksheet, options);
//sr.ToImage(0, "e:\\test2\\fontkerning1.jpg");
sr.ToImage(0, "e:\\test2\\underline1.jpg");
Thanks for providing further details, screenshots and code snippets.
I was able to reproduce the issues as you mentioned (via screenshot) when using your sample Excel file and sample code snippets. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s):
- CELLSNET-58093 - Font kerning for certain text seems to be off when compared to Excel
- CELLSNET-58094 - Underlines are breaking in texts or titles when rendering sheet to image
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@JThomas98
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-58128
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi @JThomas98
For the issue of arrow style, we have recorded it as CELLSNET-58128 ( Optimize the style of the line arrow) and resolved it. The result is shown in the figure, and it will take effect in version 25.4.
arrow-fix.png (3.4 KB)
For CELLSNET-57840, it contains several issue:
1, font type is different in both sets of chart.
This issue has been addressed and resolved in “CELLSNET-57841 (Wrong Font Issue)”, you can confirm it after using the 25.4 version.
2, Labels moved for small proportions in Pie chart.
3, missing labels on bottom-left bar chart.
4, font kerning is reduced in some chart labels.
The results of the repair are shown in the following figure.
CELLSNET-57840-fix.png (251.5 KB)
For the position of the labels around the pie chart, since the label position in Excel is automatically placed (unless you manually drag it and save it). This auto-placement rule, Excel did not make it public, so we are trying to approximate it as close as possible for now.
In the picture above you can see that some of the labels positions have been optimized but some are still not the same as in Excel. This work was previously recorded in “CELLSNET-57939 - The position of the pie chart label is incorrect when converting chart to image”. So we will close “CELLSNET-57840” and to track this task in “CELLSNET-57939”.
@JThomas98
For CELLSNET-57938 ( The top value of the first bar chart on the right has been cropped), the optimization results are as follows, and it will take effect in version 25.4.
CELLSNET-57938-fix.png (43.0 KB)
This is perfect, thanks.
Thank you for your feedback.
We’ll keep you informed with updates as soon as the new version becomes available.
@leoluo , I can’t confirm the font kerning fix is what I’m expecting as the output isn’t clear enough.
The placement of values around/within pie charts seems okay. I think I can work with it.
Font type issue, missing labels on bottom left chart are fixed, I can confirm.
Thank you for the feedback and confirmation. For the font fix, we will check whether we can give better solution for you to check and we will give feedback soon.
For issue:
CELLSNET-58039 The blue headers are rendered with unnecessary vertical lines - Sheet to image conversion
The cells are filled with same background. During rendering, we fill cell area cell by cell with the set background color. There is no gap between cells. However, the white lines(gap) appear between cells while with SmoothingMode.HighQuality option. We can’t fix the issue in this case.
@peyton.xu, I’m not sure I’m following what you explained. Is the white lines coming through because the border is not the same color as the background of the cell?
The white lines(gap) appear between cells when you set SmoothingMode.HighQuality option. Please don’t set SmoothingMode.HighQuality and it will work better.
Okay, I’ll try it out and get back to you. Thanks.