divide page in pdf with page break using php

Solutions on MaxInterview for divide page in pdf with page break using php by the best coders in the world

showing results for - "divide page in pdf with page break using php"
Nicolò
17 Jan 2018
1$itemCount = 0;
2foreach ( $invoice['InvoiceDetail'] as $key=>$item){
3    $itemCount++;
4    $html .= '<tr style="border-bottom: 1px solid #ccc; line-height: 15px;">';
5
6        /* snip */
7
8        if ($itemCount % 20 == 0) {
9            $html .= '<tr><td><div style="page-break-before: always;"></div></td></tr>';
10        }
11
12        $html .= '<td style="text-align: left"><h5>'.$itemNo.'</h5></td>';
13        $html .= '<td style="text-align: left">'.$itemName.'</td>';
14        $html .= '<td style="text-align: left">'.$price.'</td>';
15        $html .= '<td style="text-align: left" width="10px">'.$quantity.'</td>';
16        $html .= '<td style="text-align: right">'.$total.'</td>';
17
18    $html .= '</tr>';
19}
20