1

I am having problems when it comes to show Spanish characters in a pdf file made with html2pdf. I take some data from my database, codified in UTF-8, and everything is correctly shown, expect this kind of letters: á, í, é, ñ and so on. When I init html2pdf I do it this way:

$html2pdf = new HTML2PDF('P', 'A4', 'es', true, 'UTF-8', array(10, 10, 10, 5));

But the letters keep not showing correctly. Any suggestion would be greatly appreciated. Thanks in advance.

2

Try adding this last thing (SET NAMES UTF8) to the connection to your database : $dbconn = mysql_connect($host, $dbuser, $dbpass) or trigger_error(mysql_error(), E_USER_ERROR); mysql_select_db($dbname, $dbconn); mysql_query("SET NAMES UTF8");
html2pdf 4.03