I'm trying to generate a labels for the members. It comes with two things Address and Name. I'm using mpdf to generate pdf. I don't know why mpdf is not generating pdf for twenty second data on-wards.
So, i tried to check it by replacing same data on 21st data on-wards. and again the result is same. I tried like below to create the problem I'm facing.
change for loop increment number from 21 to 22 and that's all...! Mpdf stops working. why only for 21st data it will generate pdf ? I Don't know.
require_once __DIR__ . '/vendor/autoload.php';
$style= "<style>html,body{height:297mm;width:210mm;padding: 8mm 4mm 8mm 4mm} p{font-size:14px;} div{overflow:hidden;width:65mm;height:38mm; float:left;border:1px solid;margin:0;padding:-2 0 -2 5px;} </style>";
for ($x = 0; $x < 21; $x++) {
$data .= "<div style='page-break-inside:avoid;padding:5px;'><p>ANAND S.N.</p><P> #54, M/S, RAJATHA ENTREPRISE V.T.STREET, SARJAPURA POST
BENGALURU RURAL, ANEKAL, 562125</P></div>";
}
$data_print = $style.'<p>'.$data.'</p>';
echo $data_print;
$mpdf = new mPDF();
// $mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML($data_print);
$mpdf->Output('mpdf.pdf','D');
I have more then twenty thousand records list and I need to take print on this format. So, will mpdf work or Do i need to go for any other alternatives.