2
Contributors
1
Reply
14
Views
1 Year
Discussion Span
Last Post by Bachu
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.