I want to print an HTML page and get a bit more control on the print layout I get so I started by setting @page to a specific size (A4 portrait in my case) and now I need to check if some dynamic content I have can fit into that page or do I have to split it manually in a few places.
Main problem I have is how to get the Print Page height/width dimensions.
I tried setting a div with width and height 100% and getting the height of that but it gives me a wrong result. For easy testing you can use this: https://playground.jsreport.net/w/anon/KpNomfIu (it's a library to print to PDF that basically just uses chrome to print and shows the pdf).
I'm getting always 600px as height no matter if I use A3 or A4 or A1 so clearly this is wrong.
This only needs to work on Chrome. (I understand this is odd but I need a layout that is not possible to achieve using CSS3 Paged Media and everything related)