Search code examples
phppdfsymbolsmpdfeuro

Mpdf unable to print euro symbol (€)


I'm using mpdf to convert a table in html to pdf.

This table includes euro symbols (but may contain other currency symbols in the future) the thing is, although I set mpdf charset to utf-8, it keeps printing either (€) or (¬) symbols (no brackets).

This is what I have tried so far:

  • using utf8_encode and decode functions.
  • Both windows-1252 and iso-8859-15 encoding (mpdf charset). different ways to write the same character (€ €, €)

Here is my code so far:

$mpdf= new mpdf('utf-8', array(210,320));
$mpdf->AddPage("L");
$mpdf->allow_charset_conversion = true;
$mpdf->charset_in = 'utf-8';

$mpdf->WriteHTML( utf8_encode("test € €, €"), 2);
//OUTPUT
$mpdf->Output("test.pdf",'F');
echo $pdf_name;

As a result i get: [https://i.sstatic.net/vUpHi.png][1]


Solution

  • In the end the solution was to upgrade to 7.1.