Spacing increases when breaking page with Dompdf

Asked

Viewed 155 times

1

Hello! I created a contract with Dompdf more when breaking the page is increased the space always in the first page information and so on, I have made several modifications to my code and I could not take that space. I would like the help of someone with discerning eyes to see the code.

Follows

<style>
    body{
        font-family: "Georgia" !important;
        font-size: 16px;
        color: #000;
        height: 100%;
    }

    .capa{padding:5px; }
    .page_break{ page-break-before: always; }
    @page { margin: 100px 25px 100px; }
    p { margin: 0px; }

    #header {
        position: fixed;
        text-align: center;
        margin-top: -70px;
        width: 100%;
    }
</style>

$lista = '';
    // CONSULTA PARA BUSCAR AS CLÁUSULAS
    $sql2 = "SELECT c.*, cl.* FROM contratos c, clausula cl WHERE c.id = cl.idContrato AND c.id = ".$_GET['id']." order by cl.ordem";
    $resul2 = mysql_query($sql2, $this->conexaoMysql());

    while ($resp2 = mysql_fetch_array($resul2)) {
        // CONSULTA PARA BUSCAR OS ITENS DO CONTRATO
        $sql3 = "SELECT i.* FROM clausula cl, itens_contrato i WHERE cl.id = i.idClausula AND i.idClausula = ".$resp2['id']." ORDER BY ordem ASC, ordenar ASC";
        $resul3 = mysql_query($sql3, $this->conexaoMysql());

        $lista.=utf8_decode('
        <table width="90%" border="1" cellpadding="2" cellspacing="0" align="center">
            <tr>
                <td colspan="2" style="text-transform: uppercase;"><b>'.$resp2['ordem'].'. '.utf8_decode($resp2['nome_clausula']).'</b>
                <hr>
                </td>
            </tr>');
            while($resp3 = mysql_fetch_array($resul3)){
                $lista.='<tr>
                    <td width="50px;" valign="top"><b>'.$resp2['ordem'].'.'.$resp3['ordenar'].'.</b></td>
                    <td text-align="justify">'.utf8_decode($this->palavraReservada($resp3['descricao'])).'</td>
                </tr>';
            }
        $lista.='</table>';
    }

segunda página com espaço I left it edged so I could illustrate it better.

Remembering that I based myself here.

Thanks in advance for your attention

  • In order to help with the question, I generated the page only in html and no space appeared at the end of the text, so it must be at the time to render the code in dompdf. If anyone knows any function for it, thank you very much.

  • Not to leave unanswered, I managed to solve this problem here.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.