Closed jordino96 closed 7 years ago
We have troubles because doesn't correctly display the grids
Controller
public function actionPdfMif($idimpianto) { $impianto = $this->findModel($idimpianto); $pdf = new Pdf([ 'mode' => Pdf::MODE_CORE, 'format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_LANDSCAPE, 'destination' => Pdf::DEST_BROWSER, 'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/bootstrap.min.css', 'content' => $this->renderPartial('_pdf-mif'), 'options' => ['title' => 'Krajee Report Title'], 'methods' => [ 'SetHeader' => ['MIF '.$impianto->titolo_pagina], 'SetFooter' => ['{PAGENO}'], ], 'destination' => Pdf::DEST_DOWNLOAD, 'filename' => 'MIF-'.$impianto->codice_separato.".pdf", ]); return $pdf->render(); }
View
<div class="container"> <div class="row"> <div class="col-xs-12" style="background-color: red">12</div> </div> <div class="row"> <div class="col-xs-6" style="background-color: yellow">6</div> <div class="col-xs-6" style="background-color: yellow">6</div> </div> <div class="row"> <div class="col-xs-4" style="background-color: lightskyblue">4</div> <div class="col-xs-4" style="background-color: lightskyblue">4</div> <div class="col-xs-4" style="background-color: lightskyblue">4</div> </div> <div class="row"> <div class="col-xs-3" style="background-color: greenyellow">3</div> <div class="col-xs-3" style="background-color: greenyellow">3</div> <div class="col-xs-3" style="background-color: greenyellow">3</div> <div class="col-xs-3" style="background-color: greenyellow">3</div> </div> <div class="row"> <div class="col-xs-2" style="background-color: whitesmoke">2</div> <div class="col-xs-2" style="background-color: whitesmoke">2</div> <div class="col-xs-2" style="background-color: whitesmoke">2</div> <div class="col-xs-2" style="background-color: whitesmoke">2</div> <div class="col-xs-2" style="background-color: whitesmoke">2</div> <div class="col-xs-2" style="background-color: whitesmoke">2</div> </div> <div class="row"> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> <div class="col-xs-1" style="background-color: pink">1</div> </div> </div>
PDF result
Refer mPDF documentation .... it only supports CSS-2 specification and not CSS-3 styling.
But in your CSS you define col-xs-* classes... Why then? (just to understand)
We have troubles because doesn't correctly display the grids
Controller
View
PDF result![screenshot- domain - date - time](https://cloud.githubusercontent.com/assets/22366054/20486966/f170c7be-b001-11e6-8113-e22b3aeee5dd.png)