Bad text positioning in PDF with mixed size fonts

When a cell contains fonts with different sizes, the vertical positioning of the text is incorrect when performing PDF export. A sample spreadsheet, and sample out PDF are attached to demonstrate the problem.


We have a customer who we’d dearly like to convert from VSTO to Aspose.Cells, but won’t be able to with this issue, so any help gratefully received!

Thanks,

George
Hi,

Thanks for the sample files.

I can find the issue as you pointed out by converting your template file to PDF. The text in the second cell is not positioned fine which has mixed fonts. See the attached screen shot here.

I have logged a ticket with an id: CELLSNET-41123 for your issue. We will look into your issue soon.

Thank you.

…and another niggly issue in a similar area is that when text is wrapped on centered text, the cell width used appears to be larger than the actual width, resulting in ‘under-wrapping’ and text being cropped at either end in the PDF output. See updated samples attached.

Hi,


Please download and try our latest version/fix: Aspose.Cells for .NET v7.3.2.2

Your second issue does not occur in it as it works fine regarding text wrapping or text cropping issue in the cell.

We already logged your first issue, so once we figure it out, we will let you know here.

Thank you.

Thanks for the quick replies. The new build only partially resolves the issue - it does not crop the text, but the wrapping is still the same, so now it spills out the side of the cells. Putting a box around the cell shows it more clearly - see attached.

Hi,


I could not spot the issue in my output file. I just used your second template “sample.xlsx” and convert it to PDF, see the second page in the attached PDF file (which is the output file). It looks fine as per your source template sheet’s wrapped text/data.

Sample code:
Workbook wb = new Workbook(@“e:\test2\sample.xlsx”);
wb.Save(“e:\test2\sample.pdf”);

If you still find the issue with v7.3.2.2 (please try it), kindly paste your sample code here, we will check your issue soon.

Thank you.

Center-justify the text (as per attached), and then you’ll see the problem.


George

Hi,

I am still unable to find this issue using the test code below with the latest version:
Aspose.Cells
for .NET v7.3.2.2


I have attached the screenshot for your reference.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\mysample.xlsx”;


Workbook workbook = new Workbook(filePath);


PdfSaveOptions opts = new PdfSaveOptions();

opts.OnePagePerSheet = true;


workbook.Save(filePath + “.out2.pdf”, opts);


Screenshot:

Very strange. I’m definitely using 7.3.2.2 (confirmed with a call to CellsHelper.GetVersion), and I get the result attached. Something to do with fonts? I’m using Windows 7 Pro SP1 (64-bit).

Got it. My display settings (Control Panel\Appearance and Personalization\Display) are for medium-sized fonts (125%) - if I set to 100% all is OK - the system font setting is somehow having an impact on the behaviour.


George

Hi George,


Good to know that your issue is resolved.

Feel free to contact us any time if you need further help or have any issue, we will be happy to assist you.

thank you.
GeorgeH:
Got it. My display settings (Control Panel\Appearance and Personalization\Display) are for medium-sized fonts (125%) - if I set to 100% all is OK - the system font setting is somehow having an impact on the behaviour.

George
Hi,

Thanks for your feedback.

We were able to replicate this issue by setting display font size to 125%. We will look into it and fix this issue.

I have attached the output pdf file and display settings to reproduce this issue.

Screenshot:

Hi,


Please try the attached version, we have fixed your issue now.

Thank you.

That’s great - thanks for your quick response on this.

George

Hi,

Thanks for using Aspose.Cells.

You are welcome. Hopefully, this fix will be working fine. Let us know your feedback.

If you find any issue or have any questions, please feel free to post, we will be glad to help you asap.

The issues you have found earlier (filed as CELLSNET-41123) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.