The totpages package
Wilhelm D. Müller · 2005
This package counts the total number of pages shipped out to the dvi file, which allows sentences like “This document contains 10 pages, the last one being no. 1243. ” to be produced automatically. The counter itself may be shipped out to the dvi file, too, allowing page access by absolute page numbers, or it may be just a regular L ATEX counter. It cooperates with the package hyperref, producing a hyperlink to the last page—though this is not of much use as hypertext readers usually allow direct access to the last page anyway. Optionally, the number of sheets of paper needed to print the document