Emf converted from Aspose.Cells is not exactly accurate

Hi,

When converting an Excel chart to emf using Aspose, I noticed the image was not very accurate, and it was getting worse when pasting the image to a .docx and then convert it to pdf.

Code:

        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[0];
        sheet.Charts[0].ToImage(@"out.emf", options);

The output is good but still have noticeable difference from the original chart. I’ve attached the test files and a screenshot for your reference. Could you please look into that?

Thanks,
image.png (81.1 KB)
output.zip (131.6 KB)

@ServerSide527,

Thanks for the template file, sample code and screenshot.

After an initial test, I am able to observe the issue as per your screenshots by rendering image from the chart in the template file. I found the output EMF image for the chart is not accurate enough:
e.g
Sample code:

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[0]; 
        sheet.Charts[0].ToImage(@"out.emf", options); 

I have logged a ticket with an id “CELLSNET-45864” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

@ServerSide527,

This is to inform you that we have fixed your issue CELLSNET-45864 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@ServerSide527,

Please try our latest version/fix: Aspose.Cells for .NET v18.1.4:

Your issue should be fixed in it.

Let us know your feedback.

The issues you have found earlier (filed as CELLSNET-45864) have been fixed in this Aspose.Cells for .NET 18.2 update.

Please also check the following article: