I have a question: I tried to export a pdf with dompdf and php but I can't do this and I dont understand where is my problem, so my code is:
public function generateTitlePage($company)
{
$this->load->library('dompdf_gen');
$html='
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<div style="margin-top:20px;text-align: center;font-weight: bold">
Company:'.$company.'
</div>
</body>
<html>';
$dompdf = new DOMPDF();
$html = stripslashes($html);
$dompdf->load_html($html, 'UTF-8');
$dompdf->set_paper('a4', 'portrait');
$dompdf->render();
$dompdf->stream("welcome.pdf");
}
For example if I have ă in my pdf this symbol is converted in : %C4%83
I tried to find similar and I found, that many other users has the same problem with UTF-8 encoding. They found solution by changing
mbstring.encoding_translation
toOn
inphp.ini
configuration file:Or for some helped
utf8_decode()
function: