I am trying to figure out where a browser, in particular firefox or chrome, will insert page breaks when printing or printing a preview of an HTML document. At the moment, I do not want to avoid breaks, and I do not want to determine exactly where to put the break. I know the page-break- * elements as defined in CSS 2.1 and CSS 3.0. I really want to find out the last element on the current page and the first element on the next page and associate them with the actual HTML code.
As far as I know, there are no events or signals for which I could register. The next thing I was thinking about is patch webkit or gecko and add a custom signal / event. But this is only possible if the page break code is not scattered too many files and members.
I do not ask for a complete solution, but rather any thoughts or hints on how this can be achieved at all.
Thanks in advance for any suggestions or ideas :)
UPDATE: I need to find out that the position of the page is broken programmatically, since I want to change and process the original HTML file depending on the result.
source share