-
-
Notifications
You must be signed in to change notification settings - Fork 762
Description
What problem does this feature solve?
Hello, I needed to implement two methods to get the height of elements and internal content.
The usage scenario was as follows: I have a set of elements that will be added in stages, which can be text, tables, lists, etc. Let's assume they are only tables, and the content of these tables varies greatly (it's loaded from a database). I'll add the tables one after the other while the page has enough space. If the remaining space is insufficient, I'll add a page break, and I'll insert the next tables on the remaining pages.
Page with table with broken content

What does the proposed API look like?
After adding each table, I calculate the height of the next table. I also need to know the size of the remaining space on the page to check whether the table to be inserted will fit on the current page. If the table is larger than the remaining space on the page, I'll insert a page break and add the table to the next page.
This way, I can control whether parts of the content are cut off and are displayed in their entirety. Of course, if a table is larger than a page, I'll let it "cut" because there's nothing else to do.
I'd like to know if the author might find these implementations useful for the project. It's not quite a paragraph control, but it allows the developer to control the display of their content if desired. There are two methods implemented, both with approximately 30 lines each: getHeightElementList(elementList: IElement[]) and getInternalHeightsPages(rowList?: IRow[]). I copied parts of the computePageList() and computeRowList() methods for this.
Would you like me to submit a PR for review?
