GET CURRENT PAGE AND LAST PAGE - PDF PRINT (Simple Reports with PDF)

GET CURRENT PAGE AND LAST PAGE - PDF PRINT (Simple Reports with PDF)

  

I'm trying to create a PDF where the footer will only show on the last page. I can't seem to figure out how to determine if it is the last page programmatically. Can someone help me with this query?