wkhtmltopdf page-break-after not working

1k Views Asked by At

I know this has been discussed a lot of times, I tried everything but not success.

Everything I tried just not has any effect, other css working perfectly. I can't understand why is not break div to a another page.

Here is my code:

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>

MY 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);

Why is not working?

0

There are 0 best solutions below