使用mPDF时,扫描不会旋转

问题描述 投票:0回答:1
    $css  = '
        <style>

            * {
                margin: 0;
                padding: 0;
            }

            div.titulos {
                height: 200px;
                background-color: #CCC;
            }

            div.registros {
                height: 30px;
                border-top: none;
            }

            div.titulos, 
            div.registros { 
                width: 870px;
                margin: 0 auto;
                border: thin solid #000;
            }

            div.titulos div, 
            div.registros div {
                float: left;
                text-align: center;
                vertical-align: middle;
                border-left: thin solid #000;
            }

            div.titulos div:nth-child(1), 
            div.registros div:nth-child(1) {
                border-left: none;
            }

            span {}

            span.normal {}

            span.rotate {
                height: 200px;
                rotate : -90;
                text-rotate : -90;
                writing-mode: vertical-rl;
                transform: rotate(180deg);
                transform-origin: center;
            }

        </style>
    ';

    $body = '   

    <div class="titulos">

        <div style="width: 100px;"><span class=normal>Nome do Gcéu</span></div>
        <div style="width: 100px;"><span class=rotate>Supervisor</span></div>
        <div style="width: 100px;"><span class=normal>Líder</span></div>
        <div style="width: 050px;"><span class=rotate>Houve Supervisão?</span></div>
        <div style="width: 050px;"><span class=rotate>Houve dia de Jejum?</span></div>
        <div style="width: 050px;"><span class=rotate>Houve dia de Evangelismo?</span></div>
        <div style="width: 050px;"><span class=rotate>Membros Compromissados</span></div>
        <div style="width: 050px;"><span class=rotate>Visitantes</span></div>
        <div style="width: 050px;"><span class=rotate>Crianças de 0 a 12 anos</span></div>
        <div style="width: 050px;"><span class=rotate>Total de presentes</span></div>
        <div style="width: 050px;"><span class=rotate>Ofertas</span></div>
        <div style="width: 050px;"><span class=rotate>Discipulados</span></div>
        <div style="width: 050px;"><span class=rotate>Número de decisões</span></div>

    </div>

    <div class="registros">

        <div style="width: 100px;">Gceú</div>
        <div style="width: 100px;">Carlos</div>
        <div style="width: 100px;">Cleo</div>
        <div style="width: 050px;">Sim</div>
        <div style="width: 050px;">Sim</div>
        <div style="width: 050px;">Não</div>
        <div style="width: 050px;">12</div>
        <div style="width: 050px;">3</div>
        <div style="width: 050px;">3</div>
        <div style="width: 050px;">18</div>
        <div style="width: 050px;">12.3</div>
        <div style="width: 050px;">2</div>
        <div style="width: 050px;">1</div>

    </div>  
    ';

    //echo $css.$body;

    require 'vendor/autoload.php';
    $mpdf = new \Mpdf\Mpdf();
    $mpdf->SetDisplayMode( 'fullpage' );
    $mpdf->WriteHTML( $css, 1 );
    $mpdf->WriteHTML( $body );
    $mpdf->Output();

输出到PDF时,代码输出不正确。

以下是PDF输出的示例屏幕截图:

screenshot of pdf output

注意跨度的class=rotate,但不是旋转。我可以改变什么来解决这个问题?

我需要它工作,因为它会在浏览器中显示时被按下。

我用rotate : -90;text-rotate : -90;writing-mode: vertical-rl;transform: rotate(180deg);尝试过,但这些都没有。这是为什么?

mpdf
1个回答
0
投票

物业text-rotate仅支持mPDF中的trthth元素。

transform: rotate仅支持img元素。

另见supported CSS documentation

© www.soinside.com 2019 - 2024. All rights reserved.