-1

I want to create multiple pages, but each one with diferent orientation

1st page -> Potrait
2nd page -> Landscape
3rd page -> Potrait
4th page -> Potrait
....

With TCPDF will be easy to solve

$pdf = new TCPDF('P', PDF_UNIT, 'LETTER', true, 'UTF-8', false); // create PDF
$pdf->AddPage('L', PDF_UNIT, 'LETTER', true, 'UTF-8', false); // Add page Landscape
$pdf->AddPage('P', PDF_UNIT, 'LETTER', true, 'UTF-8', false); // Add page Potrait
$pdf->AddPage('L', PDF_UNIT, 'LETTER', true, 'UTF-8', false); // Add page Landscape
....

With Dompdf and Laravel no idea how can I solve. Thanks.

Richard
  • 333
  • 1
  • 3
  • 6

1 Answers1

1

As far as I know you cannot create one page at a time or append another page with DomPDF because it renders the whole layout at one time.

You have actually two options here:

  • reate multiple single file pdf files using DomPDF and then join those using tools like pdftk
  • Join all your view files together and wrap them inside a div with css property page-break-after: always; More info here How to create several pages with dompdf
Mohsen Nazari
  • 1,281
  • 1
  • 3
  • 13