Automatically count the pages in a PDF and display the total in the PDF display panel

It would be wonderful if the number of pages in a PDF could be counted and displayed in the reference attribute.