The image Aspose.Cell captures does not look like the original excel chart

@JThomas98,

Sure, please try it and let us know your feedback.

@JThomas98,

By the way, I tested using your template Excel file and following sample code (I removed the relevant line of code which sets SmoothingMode.HighQuality).
e.g.,
Sample code:

Workbook workbook = new Workbook("e:\\test2\\Chart_Template.xlsm");
// Access the worksheet
Worksheet worksheet = workbook.Worksheets["Summary"];

// Set the print area with your desired range in the worksheet
worksheet.PageSetup.PrintArea = "M10:AQ40";
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
};
// Take the image of your worksheet
SheetRender sr = new SheetRender(worksheet, options);
sr.ToImage(0, "e:\\test2\\out1.jpg");

Please find attached the output image which is fine tuned and I do not see white lines(gap) between cells.
out1.zip (44.5 KB)

@amjad.sahi, thank you for testing it out for me. I see the cause is that particular property. I’ll have to run the different charts we have to make sure disabling that property does not cause unacceptable outputs.
I started using that property as some of our charts have shapes that are small in size and when we render them, it looked pixelated. I was suggested this property to fix the issue.

@JThomas98,

I think you may try to use SmoothingMode attribute for all cases except for this particular case (where those white lines (gap) between cells are rendered).

Hi @JThomas98
About the font kerning, this might be the same issue as the font correction, the font kerning should be fixed when the font is corrected (as shown below, The spacing between numbers and percent signs becomes normal after font correction. I think this is because the character spacing is different in different fonts).
kerning.png (12.8 KB)

You can confirm it after using 25.4, and if there are any issues, please do feedback, we’ll continue to investigate.

@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-58131

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.

For the issue of the missing vertical line, we recorded it as CELLSNET-58131 and it has been fixed, the result is as follows, it will take effect in version 25.4.
MissingLineFix.png (17.8 KB)

The issue of font kerning I showed recently seems to be happening every time the letter ‘i’ is in the chart. Can yo make sure it’s not happening after this fix? Thanks.

Here is the screenshot of what I mean:
Test_04042025.zip (8.8 MB)

This is looking good. Thank you!

@JThomas98

Workbook wb = new Workbook(dir + "Chart_Template.xlsm");
 // Access the worksheet
 Worksheet worksheet = wb.Worksheets["ExecSummary"];

 // Set the print area with your desired range in the worksheet
 worksheet.PageSetup.PrintArea = "C3:D16";
 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
 };
 // Take the image of your worksheet
 SheetRender sr = new SheetRender(worksheet, options);
 sr.ToImage(0, dir +"dest.jpg");

Please check
dest.zip (7.6 KB)

generated by the above codes.
Could you share how to generate the screenshot?

@JThomas98,

This is to inform you that your issue (logged earlier as “CELLSNET-57940 - Horizontal and vertical labels are garbled when converting chart to image”) has been resolved. The fix/enhancement will be included in the next release (Aspose.Cells v25.4), scheduled for the release in this week. You will be notified as soon as the new version is released.

I inserted the picture aspose captured into a word document for the ease of viewing.
I’ve used the code:

 Document RepDoc = new Document();
 DocumentBuilder Builder = new DocumentBuilder(RepDoc);
 using (Workbook TemplateWB = new Workbook(@"C:\Test_04042025\Chart_Template.xlsm"))
 {
    Worksheet sourceWS = TemplateWB.Worksheets["ExecSummary"];

    //Set print area
    sourceWS.PageSetup.PrintArea = $"C3:D16";
    sourceWS.PageSetup.LeftMargin = 0;
    sourceWS.PageSetup.RightMargin = 0;
    sourceWS.PageSetup.TopMargin = 0;
    sourceWS.PageSetup.BottomMargin = 0;
    // Clear any header/footer as they'll be captured when converting the worksheet to image
    sourceWS.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
    };

    // Take the image of your worksheet
    SheetRender Render = new SheetRender(sourceWS, options);
    // Create a stream to save the image in
    MemoryStream ImgStream = new MemoryStream();
    Render.ToImage(0, ImgStream); //Returns an image of the cell range if an accuarate cell range is suppiled
    if (ImgStream != MemoryStream.Null)
    {                        
        // Insert this image into the place of the old shape.
        Shape newOleShape = Builder.InsertImage(ImgStream);
        Aspose.Words.PageSetup PS = Builder.CurrentSection.PageSetup;
        double PageWidth = PS.PageWidth - PS.LeftMargin - PS.RightMargin;
        if (PageWidth < newOleShape.Width)
        {
            newOleShape.Width = PageWidth;
        }
    }
}
RepDoc.Save(@"C:\Test_04042025\Word_Template.docx");

I then shared the screenshot of what it looks like in the word document.
Test_04042025.zip (8.5 MB)

I hope this clears your confusion. Sorry for the delayed reply.

Thanks for the update. Could I see a screenshot of the fix if possible? Thanks.

I have another situation that I’d like to show you.

Test_04072025.zip (176.9 KB)

The code I’ve used is:

Document RepDoc = new Document();
DocumentBuilder Builder = new DocumentBuilder(RepDoc);
using (Workbook TemplateWB = new Workbook(dir + @"\Test_04072025\Excel_Template.xlsm"))
{
    Worksheet sourceWS = TemplateWB.Worksheets["Q038_STND_1"];

    //Set print area
    sourceWS.PageSetup.PrintArea = $"P51:AK102";
    sourceWS.PageSetup.LeftMargin = 0;
    sourceWS.PageSetup.RightMargin = 0;
    sourceWS.PageSetup.TopMargin = 0;
    sourceWS.PageSetup.BottomMargin = 0;
    // Clear any header/footer as they'll be captured when converting the worksheet to image
    sourceWS.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
    };

    // Take the image of your worksheet
    SheetRender Render = new SheetRender(sourceWS, options);
    // Create a stream to save the image in
    MemoryStream ImgStream = new MemoryStream();
    Render.ToImage(0, ImgStream); //Returns an image of the cell range if an accuarate cell range is suppiled
    if (ImgStream != MemoryStream.Null)
    {                    
        // Insert this image into the place of the old shape.
        Shape newOleShape = Builder.InsertImage(ImgStream);
        Aspose.Words.PageSetup PS = Builder.CurrentSection.PageSetup;
                            double PageWidth = PS.PageWidth - PS.LeftMargin - PS.RightMargin;
                            if (PageWidth < newOleShape.Width)
                            {
                                newOleShape.Width = PageWidth;
                            }
    }
}
RepDoc.Save(dir + @"\Test_04072025\Word_Template.docx");

I have highlighted the issues in red in the word document named “Word_Template.docm”

Issue #1 - The shapes in the graph plotting seems to lower resolution when compared to its legends to the right of the graph. Column “Markers” next to the graph shows the legends. This is highlighted in green in the word document.

Issue #2 - The shapes that overlap with the x-axis and y-axis are somehow behind the axis. Where as if you look at excel equivalent, you’ll notice that the shape seems to be in front of the axis. These are highlighted in red in the word document.

Issue #3 - Some shapes under the column “Marker” have an underline/bottom border. Not sure how this is happening. But the excel equivalent doesn’t have this. These are highlighted in orange in the word document.

@JThomas98

We will try to provide the screenshot generated by the new fix for your reference. And for the newly reported issues, we will look into them too.

However, because there are too many irrelevant topics and issues in this thread, it becomes more and more difficult to discuss them separately and track the status of those tickets. We believe it would be much better if you could record every new issue in a new post so we can discuss them separately and clearly.

Sure, I can create a new ticket for issues I’ve reported today.

@JThomas98,

I simply inserted the output image shared by @simon.zhao into a MS Word (new) document manually and noticed the issue you have highlighted. We will evaluate the issue thoroughly and get back to you soon.

Thanks for the confirmation. I’ve created another ticket with the new issues I’ve highlighted.

@JThomas98,

Yes, we already reproduced all three issues and replied in your other thread. Please see and follow up your other thread for replies and for your reference.

Hi @JThomas98
For CELLSNET-57940 ( Horizontal and vertical labels are garbled), we have fixed it, the result is as follows, it will take effect in 25.4.
CELLSNET-57940-fix.png (57.3 KB)