Count Records in PDF & Last page

Dear SC Develpper,

1- I want to make a counter for every record
2- I want to put repetative footer only in last page

I face this error many times and asked many users in this forum.
So, After searching I found some answers , But I still face the same error

Please can you help me and solve this issues.

Hi, here a forum about that: