Symbol in chart incorrectly rendered when using aspose cells

Hi Aspose Team,

I’m noticing an issue with a symbol not rendering correctly when I convert a chart to image using aspose cells. I’m using the latest version of aspose cells, V25.4.0.

Here’s the code I’ve used:

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

    //Set print area
    sourceWS.PageSetup.PrintArea = $"B55:M96";
    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_04112025_02\Word_Template.docx");

Test_04112025_2.zip (2.7 MB)

I’ve highlighted the issue within the word document. You’ll notice that the symbol next to the values are not rendered properly.

@JThomas98

It seems you are experiencing an issue with a symbol not rendering correctly when converting a chart to an image using Aspose.Cells. This can sometimes occur due to the way certain symbols or fonts are handled during the conversion process.

Here are a few suggestions to troubleshoot and potentially resolve the issue:

  1. Check Font Availability: Ensure that the font used for the symbol is installed on the machine where the conversion is taking place. If the font is not available, Aspose.Cells may substitute it with a different font, which could lead to rendering issues.

  2. Use Different Image Formats: You are currently using ImageType.OfficeCompatibleEmf. Try changing the image type to another format, such as ImageType.Png or ImageType.Jpeg, to see if that resolves the rendering issue.

  3. Update Aspose.Cells: Make sure you are using the latest version of Aspose.Cells. If you are already on version 25.4.0, check if there are any patches or updates available that address rendering issues.

  4. Test with a Simplified Chart: Create a simplified version of your chart with just the problematic symbol to isolate the issue. This can help determine if the problem is with the specific chart or the conversion process itself.

  5. Review Documentation and Examples: Check the Aspose.Cells documentation and examples related to chart rendering and image conversion. There may be specific settings or methods that can help improve the rendering of symbols.

If the issue persists after trying these suggestions, consider reaching out to Aspose support with a minimal reproducible example, including the specific symbol that is not rendering correctly. This will help them diagnose the problem more effectively.

If you need further assistance, feel free to ask!

Sorry, this issue was fixed by installing the right font. Please discard this ticket.

@JThomas98

Glad to know your issue is resolved. Feel free to contact us if you have any questions or need further assistance.