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.
…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.
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.
Center-justify the text (as per attached), and then you’ll see the problem.
I am still unable to find this issue using the test code below with the latest version:
for .NET v188.8.131.52
I have attached the screenshot for your reference.
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);
Very strange. I’m definitely using 184.108.40.206 (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.
Hi,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
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.
That’s great - thanks for your quick response on this.
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.