Automatic page breaks with mpdf

Viewed 434

enter image description here

I want to create a PDF with mpdf (laravel) but there is no additional page created automatically. Even the footer is ignored. The content just gets printed within the footer rather then on a new page. The table fits on one page but below the table is additional things like "aside" tag which also contains a table or additional "aside" tags with a paragraph "p". In this example I expect the additonal "aside" tags to be moved on a new page.

The PDF gets loaded from a blade template in chunks with this snippet:

/** @var LaravelMpdf $pdf */
$pdf = PDF::chunkLoadView(
    '<html-separator/>',
    'pdf.invoice.default',
    compact('invoice'),
    [],
    $config
);

The corresponding CSS for footer is:

@page {
    header: page-header;
    footer: page-footer;
}

#footer {
    /*position: absolute;*/
    padding-bottom: 30px;
    font-size: 8px;
    color: #606060;
    width: 100%;
}

#footer .flex-col {
    float: left;
    width: 28%;
}

I also tried setting "page-break-before: always;" on the last aside blocks but this results in one single nearly empty PDF being created. So the table and aside blocks are not visible anymore.

0 Answers
Related