Page break in print

Asked

Viewed 139 times

1

I’m making some wallets and I need to break the page when I give 8 card on the sheet

I made a code that only skips the front page.

css

@page {
                /*margin top,direita,rodape,esquerda*/
                margin-left: auto;margin-right: auto;
                /*margin: 0.85mm 5mm 0.85mm 5mm;*/
                margin: 5cm!important;
            }
            /*div{border: 0.01px solid black;}*/

            .corpo{width: 201.2mm;height: auto;margin-left: auto;margin-right: auto;}
            .clear{clear:both;}
            .carterinha{width: 10cm;height: 7cm; border:1px solid #f8f7f7;float: left;}
            .carterinha-corpo{margin: 3mm;border:1px solid black;}
            .cabecalho{width: 100%;height: 1.5cm;}
            .cabecalho-logo{width: 3.9cm;height: 1.5cm;float: left;}
            .cabecalho-info{width: 5.4cm;height: 1.5cm;float: left;font-family: serif;font-size: 7.5pt}
            .foto-aluno{width: 100%;height: 4cm; }
            .foto{width: 3.1cm;height: 4cm;float: left;}
            /*background: green; background: orange background: #babaca;*/

            .aluno{width: 5.7cm;height: 3.8cm;float: left;border: 1px solid black; font-size: 7pt;padding: 0.1cm 6px 0.1cm 6px;}

            .titulo{font-size: 6.5pt;}
            .conteudo{font-size: 8.5pt;}
            .rodape{width: 100%;height: 0.86cm;}
            .validade{padding-top: 0.35cm;width: 3.1cm;height: 0.51cm;float: left;font-size: 7pt;text-align: center}
            .diretoria{padding-top: 0.35cm;width: 5.98cm;height: 0.51cm;float: left;font-size: 7pt}
            img.logoimg{width: 3.2cm;padding-top: 2mm; padding-left: 3.5mm;}
            img.simbolo{width: 2.2cm;padding-top: 0.6cm; padding-left: 0.5cm;}

            .break {page-break-after:  always;}

            .left{float: left}
            p{margin-top: 0px; margin-bottom: 5px;}

handbag

foreach($ar as $row) {
                $cont++;

                ?>
                <div class="carterinha">
                    <div class="carterinha-corpo">

                        <div class="cabecalho">
                            <div class="cabecalho-logo">
                                <img src="imagens/logo-carterinha.png" class="logoimg">
                            </div>
                            <div class="cabecalho-info">Associação dos Estudantes Universitários de Acreúna - GO<br />37.275.880/0001-19<br />Avenida Corumbá, nº 112 - Centro</div>
                        </div>
                        <div class="clear"></div>
                        <div class="foto-aluno">
                            <div class="foto">
                                <img src="imagens/simbolo-carteirinha.png" class="simbolo">
                            </div>
                            <div class="aluno">
                                <p>
                                    <span class="titulo">Nome<br /></span>
                                    <span class="conteudo"><?php print converterCaracterPM($row->no_pessoa); ?></span>
                                </p>
                                <p> 
                                    <span class="titulo">Instituição de Ensino<br /></span>
                                    <span class="conteudo"><?php print $row->no_faculdade; ?></span>
                                </p>
                                <p>

                                    <span class="titulo">Curso<br /></span>
                                    <span class="conteudo"><?php print $row->no_curso; ?></span>
                                </p>
                                <div>
                                    <div class="left" style="width: 2.80cm;">
                                        <p>
                                            <span class="titulo">Data de Nasc.<br /></span>
                                            <span class="conteudo"><?php print DataDB2BR($row->dt_nascimento); ?><br /></span>
                                        </p>
                                    </div>
                                    <div class="left">
                                        <p>

                                            <span class="titulo">RG<br /></span>
                                            <span class="conteudo"><?php print $row->rg; ?><br /></span>
                                        </p>
                                    </div>
                                </div>
                                <div class="clear"></div>
                                <div>
                                    <div class="left" style="width: 2.80cm;">
                                        <span class="titulo">Celular<br /></span>
                                        <span class="conteudo"><?php print $row->nu_telefone; ?><br /></span>
                                    </div>
                                    <div class="left" style="width: 2.80cm;">

                                        <span class="titulo">Código Mat<br /></span>
                                        <span class="conteudo"><?php print $row->cd_aluno; ?><br /></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clear"></div>
                        <div class="rodape">
                            <div class="validade">Validade:2016</div>
                            <div class="diretoria">Diretoria _________________________________</div>
                        </div>
                    </div>

                </div>
                <?php
                if ($cont == 8) {
                    print '<div class="break"></div>';//quebrando página
                    $cont = 0;
                }
            }
No answers

Browser other questions tagged

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