PHP-phantomjs,避免分页

Joy*_*yce 6 php-phantomjs

我正在使用PHP-phantomjs并按照我可以输出pdf和img的文档.http://jonnnnyw.github.io/php-phantomjs/

但我有分页问题.当一个图表在页面的末尾,但溢出时,它将被拆分在另一个页面中,如下面的捕获: 页面捕获

我找到了一些建议:

<div id="main" style="page-break-inside: avoid;"></div>
Run Code Online (Sandbox Code Playgroud)

但它不起作用,或者说我弄错了.如果它是解决方案,那意味着我必须在html的每个元素中写这个?听起来不太好.

Nut*_*ker 0

这里我在github上找到了一些解决方案。据我了解,PhantomJS 存在缩放页面的错误。尝试添加到正文:

body { zoom : 0.75 }
Run Code Online (Sandbox Code Playgroud)