iText pdf library
Website search

How do setMinimumSize() and setFixedSize() interact?

Is it OK to call setMinimumSize(15) on some cells in a row, and setFixedSize(15) on the other cells of the same row?

What I would like is for iText to increase the row height to accommodate the text in the cells whose minimum height is set, while letting text in cells set to a fixed height clip. Is that what iText does?

If not, how do I achieve this? While we're at it, am I correct that calling neither setMinimumSize() nor setFixedSize() is equivalent to calling setMinimumSize(0), meaning that iText makes the cell as tall as it needs to be to accommodate the text?

Posted on StackOverflow on Feb 28, 2014 by Kartick Vaddadi

There are no setFixedHeight() and setMinimumHeight() methods in iText 7. Please follow this link to see how to answer this question in iText 5.

P.S. Now we use CellRenderer to get/set the height of the cell and manipulate its content. See, for instance, ClipCenterCellContent example.

Ready to use iText?

Try our iText 7 Library and add-ons FREE for 30 days. Test your proof of concept, and see if our solution is right for you.

Get my FREE trial

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now