I would like to detect page breaks in printed HTML with javascript.
I've found many information on how to insert page breaks with CSS. My goal is, however, not modifying anything, just finding out where each page ends (coordinates in pixel, or a reference to the first or last object on a given page).
I've read the description of the pageBreakAfter property, however, it is a kind of policy, whether there can / should be a page break considering the amount of stuff already written on the page. I would like to know where actual page breaks are.
(The purpose of this detection is that based on its result I will fine-tune margins and font sizes to optimize the layout.)
Any ideas?