0
I have to generate the PDF of a 'wallet', and I have to put the front and back in the same file. I have the following source to generate the front:
$nome = $cliente->nome.'.pdf';
$pdf = \PDF::loadView('cliente.print', array('cliente' => $cliente));
$customPaper = array(0,0,153.00,240.90);// tamanho personalizado
return $pdf->setPaper($customPaper, 'landscape')->stream($nome);
The generation comes out perfect as in the photo below, now I want to add a second page just below and put the image on the back.
I already searched and tried to pass the second page in the custom size array but could not solve.
Have you ever tried to generate this wallet with HTML and CSS? Each card could be a div and you can use a <br> to break them. I think it would be a good solution.
– Paulo Martins
Yes the first page I did totally with HTML and CSS, because the data came dynamically from the database. However the second page is an image.
– Sr. Bigode
The solution to your question you find here: https://stackoverflow.com/questions/22746958/dompdf-adding-a-new-page-to-pdf/43911627#43911627 But I believe it is the case to add a new <div> and continue styling.
– Thalles Rangel
Have you thought about page-break-after?
– Wallace Maxters
Yes it was solved using page-break. Thank you.
– Sr. Bigode