I would like to know how to detect is it a new page, since i would like to write header on each page. thanks!