-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for Auto Trim Feature in PdfPCell #1119
Comments
Hi. this would be a nice feature. |
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: