- Where Developers Learn, Share, & Build Careers


Is there a way to get the height of the table before adding it to the document?

At first glance, I think the number of rows in the table is enough to calculate the height because I know the size of the font. However, some lines broke that rule. For example, a cell can store a paragraph that contains more than one row. Therefore, what I should know, is the total number of heights of each row.

Yes, the answer was not complex.

To get the height of the table, first the width of the table must first be set. In other words,

  table.setTotalWidth ((PageSize.A4.getWidth () - document.leftMargin () - document.rightMargin ()) * table.getWidthPercentage () / 100); Println (table.calculateHeights ());   

Gives the height of the table.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -