I'm creating a spreadsheet Workbook, then exporting it to PDF. Each cell I write has a custom style where the FontSize is being set to 9 (and I'm also setting up fills and font effects, like bold).
When I get through writing the data to the Worksheet(s) in the Workbook, I then call AutoFitWidth on the Columns that have data.
Finally, I use the PdfFormatProvider to write the entire Workbook to a PDF file.
My problem is that text items in the cells are being clipped, even when there is room to fit them after calling AutoFitWidth.
For example:
It seems to be worse on strings with all caps. Sometimes it's just half a letter, other times it's multiple letters (the ATMOSPHERICCORR is supposed to be ATMOSPHERICCORROSION).
Here's another export in a different format:
As you can see, there's two problems based on calculating the required width. First is that AutoFitWidth is not giving enough space (mostly in the second example), but as you can see in the first example, even when there is enough horizontal space, it's still clipping off the text area within the cell.
Is the estimation assuming no caps, or is the font size/font family throwing it off (9pt)? Or am I missing something where I can force it to make more space?