Ok after so much time spent reading their documentation, and my tests I decided to consult the SO community for a help.
I use mPDF to generate pdf from HTML. The library works fine, pdf is produced etc.
But I wasn't able to set the font-family and font-size as I want it.
Code I tried:
$mpdf = new mPDF('c', 'A4');
$mpdf->CSSselectMedia='mpdf';
$mpdf->setAutoTopMargin = 'stretch';
$mpdf->setAutoBottomMargin = 'stretch';
$mpdf->setBasePath($url);
$mpdf->SetHeader($url);
$mpdf->WriteHTML($html);
$mpdf->SetFooter($url);
$mpdf->Output($filename.'.pdf', 'I');
In my stylesheet with mpdf media, I have bunch of styles that are dealing with all of the html code. And I also have some rules for the font-family and the font-size ie:
body{
border: none;
font-size: 10pt;
colosr:#000;
font-family: Times, Georgia, "Times New Roman", serif !important;
}
But the font settings are not apllied at all.
I also tried the following params on instantiation:
$mpdf = new mPDF('UTF-8', 'A4',9, 'dejavuserif');
But still nothing. I still have sans-serif in the pdf, and also in very big size.
Can someone shed some light on this?