Hi,

I need a help from you. I tried but I can not. Can anyone tell me how to increase the font size in mPDF,

Here is the code, where I tried,

require('mpdf/mpdf.php');
$mpdf=new mPDF('C','legal','10');

Did you try Inline Styles in your HTML code like

<?php


$html = '
<h1 style="font-family: DejaVuSansMono, monospaced; font-size: 10pt;"><a name="top"></a>mPDF</h1>


';


//==============================================================
//==============================================================
//==============================================================

include("mpdf/mpdf.php");
$mpdf=new mPDF('C','','10');

$mpdf->WriteHTML($html);
$mpdf->Output();
exit;

//==============================================================
//==============================================================
//==============================================================


?>

If you are using seperate fonts like which are not in mpdf, you have to add this new fonts to in a stylesheet (CSS). Then you embed this style to your mpdf class.

Exg:

$stylesheet = file_get_contents('yourstylesheet.css');
$mpdf->WriteHTML($stylesheet,1);    // The parameter 1 tells that this is css/style only and no body/html/text

$mpdf->WriteHTML($html);

$mpdf->Output();

exit;

For more details Click Here

Here you can download mpdf package, they provide lot off examples.

Thank You.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.