I am using the great tool wkhtmltopdf to render HTML into nice PDF documents (executed from PHP). I now need to know if the HTML page I will render will fit onto "one page" in the PDF. I found out wkhtmltopdf will render ~ 1100px height on one page with my current settings.
I came up with the idea to use wkhtml2image first. I can then get the image dimensions which works fine.
Unfortunately the rendering to an image takes a long time and since I have to do it in a loop I'm looking for a faster way to do this.
Do you know any tool that will render HTML with webkit and give me back the dimensions of the resulting document? It might also be possible to use JavaScript as a helper (write dimensions into a div that can be extracted after) but I can't find a tool which gets the job done.
Any ideas or alternative approaches?