Currently, I am working on a project where I am developing a document generator that utilizes pdfHTML 3.0.3 and iText 7.1.14. The document includes a table displaying 'items'. It's worth noting that these item rows will likely span across multiple pages rather than neatly fitting onto one page.
The first column of this table displays item numbers, and it is possible that some item numbers might be missing due to void items.
I am trying to figure out a way for the table to display the first and last item number in the <tfoot>
section of the <table>
. Ideally, these first and last item numbers should be dynamically determined based on what is currently showcased on the laid-out page.
For reference, here's an example: https://i.sstatic.net/XAe2Z.png (the FROM section should display the number 1, and the TO section should show the number 5).
Unfortunately, it seems that achieving this with only HTML and CSS isn't possible since they lack support for counters that utilize the page as context (CSS counters typically use a global context rather than a page-specific one).
I believe it may be feasible to create a custom renderer based on TableRenderer
, although I'm unsure about where to begin. While the iText documentation does have examples of how to develop your own renderer, I haven't come across any specific examples related to this particular issue.