We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excel to emf text alignment is not consistent

Hi,

I noticed that the conversion from .xlsx to .emf does not output correct alignment of the text. I have attached two different examples where one has center and the other has top alignment of the cells.

We had similar issues in the past like:


Code:
var options = new ImageOrPrintOptions { ImageType = ImageType.Emf, OnePagePerSheet = true };
var book = new Workbook(@“C:\test.xlsx”);
book.Worksheets[0].PageSetup.PrintArea = “A1:A8”;
new SheetRender(book.Worksheets[0], options).ToImage(0, @“C:\test.emf”);

I’ve attached the test files for your reference. The font they use is Arial Narrow with 7pt size. Could you please help me take a look?
testAlignment.zip (30.0 KB)

Thanks,

@ServerSide527,

Thanks for the template files, documents and image files.

After an initial test, I am able to reproduce the issue as you mentioned by using your sample code with your template files. I found text alignment is not identical or consistent. Some chars in the cells are cut from the bottom as well. I have logged a ticket with an id “CELLSNET-47497” for your issue. We will look into it soon.

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

Thank you for your response. I noticed another inconsistency which might help the investigation of the issue. When I use multiple lines in a single cell, the text alignment issue seems to be more obvious. I have attached sample files from which you can see that the spacing between the lines is larger than it should be.
testMultiLine.zip (22.5 KB)

Thanks,

@ServerSide527,

Thanks for the sample file, output image and document.

We tested using your new file and we noticed the same issue/inconsistency for alignment. We have logged it with source set of files against your existing issue “CELLSNET-47497”. It may help for investigation and resolving the issue.

Once we have any new information, we will share it with you.

@ServerSide527,

Please try our latest version/fix: Aspose.Cells for .NET v20.7.2 (attached)
Aspose.Cells20.7.2 For .Net2_AuthenticodeSigned.Zip (5.4 MB)
Aspose.Cells20.7.2 For .Net4.0.Zip (5.4 MB)

Your issue should be fixed in it.

Let us know your feedback.

Thank you for the prompt response. The alignment and the spacing between the lines look correct now.

@ServerSide527,

Good to know that your issue is sorted out by the new fix. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSNET-47497) have been fixed in Aspose.Cells for .NET v20.8. This message was posted using Bugs notification tool by Amjad_Sahi