Forum How do I...?

Target div id's on specific pages, or get entire height of a page spanning multiple pages

ronniecmc
Hi, I'm struggling getting the height of a div spanning multiple pages. I'm able to find elements based on their id, apply getPrinceBoxes() and get their height. This is working fine for the elements that do not span multiple (8x10) pages and I am getting their actual height. The problem is that on divs that span multiple pages, .h is returning the height of the div on the first page that it is on, and ignoring the height of any subsequent pages. Is there a way for me to get the totality of the height of the div spanning multiple pages, or a way to search for id's on a specific page? For example, can I search for the id "container--method" on page 2? This could allow me to get the height of the overflow of the div on page 2, and add it to the height of that div from page 1.

Thank you!
ronniecmc
Oops, just realized that the title says "page spanning multiple pages" when I meant to say "div spanning multiple pages"

Also, my ideal use case with determining height of the entire element is to decrease the line height or decrease padding between either list items or p tags (depending on which td is overflowing into the next page) when there are only a couple lines of text that have overflowed into the second page.

Edited by ronniecmc

mikeday
The getPrinceBoxes() method should return a list of boxes, which may be on separate pages, as shown by the pageNum property of the box.
ronniecmc
When I apply getPrinceBoxes() it only returns the page number of the first page where the ID occurs, even though the div in the final pdf spans multiple pages.
ronniecmc
My div is inside of a <td> tag, could this be causing the issue?
ronniecmc
Never mind! I just realized that I was not iterating over the array that is returned with getPrinceBoxes()