Php phantomjs, avoid page breaks

I am using PHP-phantomjs and following the document. I can output pdf and img. http://jonnnnyw.imtqy.com/php-phantomjs/

but I have a page break problem. when the diagrams are at the end of the page but are full, they will be divided on another page, for example, a snapshot: Page capture

I found some tips:

<div id="main" style="page-break-inside: avoid;"></div> 

But it does not work, maybe I'm wrong. And if this is a solution, then I have to write this in every html element? That sounds good.

+6
source share
1 answer

Here I found some solutions on github . As far as I understand, PhantomJS has an error that scales the page. Try adding to the body:

 body { zoom : 0.75 } 
0
source

Source: https://habr.com/ru/post/1012515/


All Articles