Use bootstrap style to generate pdf file with php

3

Is there a way to use the bootstrap to style a html page that will later be converted into a pdf? I'm using the mpdf60 plugin in php, and I only need the style that boostrap offers to use it in exporting a pdf file.

Consider the following code:

    <div class="row"><div class="col-lg-4"></div><div class="col-lg-4">
    <h3>Teste PDF</h3></div><div class="col-lg-4"></div></div>

When I use inside the $ mpdf-> WriteHTML () function, the bootstrap style does not catch, just coming from the html, or any inline css. Using this mpdf60 plugin or any other, is there any way I can use the bootstrap as css?

    
asked by anonymous 09.11.2015 / 18:54

1 answer

4

You can add css files in mpdf to solve this problem, but you should consult the mpdf manual to see if it supports all bootstrap settings: mPdf Supported CSS

include('mpdf.php');
$mpdf= new mPDF();
$stylesheet = file_get_contents('bootstrap.css');
$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML($html,2);
$mpdf->Output();
exit; 
    
09.11.2015 / 19:28