wkhtmltopdf page-break-after not working

时间:2016-06-07 21:54:28

标签: php wkhtmltopdf page-break phpwkhtmltopdf

我知道这已经讨论了很多次,我尝试了一切但没有成功。

我尝试的一切都没有任何效果,其他的css工作得很好。 我无法理解为什么不将div打破到另一页。

这是我的代码:

HTML

<html>
<head>    
  <title> PDF </title>
  <style>

*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

* {
overflow: visible !important;
}

.myrow { 
float:left;
width:100%;
padding:20 10px; 
}

    .pagebreak {
     page-break-after:always;
     clear:both;
     display:block;
     }

  </style>
</head>

<body>

  <div class="myrow">
    Content
    </div>
  <div class="myrow">
    Content
    </div>
  <div class="myrow">
    Content
    </div>
  <div class="myrow">
    Content
    </div>

  <div class="pagebreak"></div>

  <div class="myrow">
    Content
    </div>
  <div class="myrow">
    Content
    </div>

  <div class="pagebreak"></div>

  <div class="myrow">
    Content
    </div>
  <div class="myrow">
    Content
    </div>

  </body>
  </html>

我的PHP

$pdf = new Pdf(array(

'margin-top'    => 0,
'margin-right'  => 0,
'margin-bottom' => 0,
'margin-left'   => 0,
'disable-smart-shrinking',
'print-media-type',

));


 $pdf->addPage(page.html);

为什么不工作?

0 个答案:

没有答案
相关问题