I got it working, but it wasn't using Header.instanceManager.count. Header.instanceManager.count seemed to be counting the number of header rows in the table, not the number of pages it rendered on. When I added enough table rows to get to 5 pages, it still only counted 1.I used xfa.host.numPages ...