I am using the PHP-phantomjs and follow the doc I can output pdf and img. http://jonnnnyw.github.io/php-phantomjs/
but I have problem with page break. when a charts in the end of the page,but overflowed, it will be split in another page,like the capture below:
I found some advice:
<div id="main" style="page-break-inside: avoid;"></div>
But it doesn't work, or maybe I get it wrong. And if it is the solution, that means I have to write this in every element of html? Sounds not good.