You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose the addition of an auto trim feature to the PdfPCell class in OpenPDF. Currently, text content exceeding cell width leads to overlap issues with neighboring cells when setNoWrap(true). Kindly Add an option to automatically trim text within a cell to fit its width. This would prevent overflow and improve table layout readability.
If this feature already exists, please let me know how to implement it.
Issue:
Expected Solution:
Additionally, could someone assist me in determining the formula for calculating the number of characters that fit within a specified width when the font size is known?
Thank you
The text was updated successfully, but these errors were encountered:
One possibility would be to set a "trimSize" on the cell or on the column. And if that is set, all cell content could be trimmed by that number of characters. This as a simple solution.
Depending on the used font, you can't determine how many chars fit in a cell, as a 5 char String has different width depending on the content. "iiiii" is much shorter than "VVVVV".
Another approach could be to "cut" the content, and checking the necessary width. And try to find the sweet spot, there the cut will be "perfect".
I propose the addition of an auto trim feature to the PdfPCell class in OpenPDF. Currently, text content exceeding cell width leads to overlap issues with neighboring cells when setNoWrap(true). Kindly Add an option to automatically trim text within a cell to fit its width. This would prevent overflow and improve table layout readability.
If this feature already exists, please let me know how to implement it.
Issue:
Expected Solution:
Additionally, could someone assist me in determining the formula for calculating the number of characters that fit within a specified width when the font size is known?
Thank you
The text was updated successfully, but these errors were encountered: