Generate report with page break in print

2

I have form which generates a list that I need to print.

This list, sometimes I will only print a few pages , so on each page, I need to have some data:

  • page number
  • previous page balance
  • Caption Header
  • records
  • final balance (last page)

Example:

Insearches,Ifound DOMPDF to print from html to PDF , but I do not know if it would be the best option, and if it was, how the break works.

I would like at least one direction to start, what is possible or not.

    
asked by anonymous 24.07.2018 / 14:59

1 answer

2

To repeat information on all printed pages , you can use the THEAD tag.

THEAD tag documentation and examples

It works fine in firefox / chrome , but to do THEAD repeat the data also in IE old css / in> below together on the page:

thead {display: table-header-group;}

To make the break page impression at a certain point, use css page-break-after along with media print , setting the page break for some element of your html.

Example:

@media print {
    footer {page-break-after: always;}
}

More page-break-after

Example of page-break-after working in-line:

<html>
    <head></head>
    <body>

        <table style="page-break-after: always">
            <tr>
                <td>asdsadsd</td>
            </tr>
        </table>
        <br/><br/>
        <div>
            qqqqqq
        </div>

    </body>
</html>
    
24.07.2018 / 15:25