Skip to content Skip to sidebar Skip to footer

Converting Html 2 Pdf (php) Using Hebrew Returns "???"

I have a using html2pdf library from this link http://html2pdf.fr/en/ and I am trying to get a simple html code into html, the problem is that my text is Hebrew langue and for some

Solution 1:

The Html2pdf simply convert an HTML content to PDF. so i would recommend you to validate the HTML that you are passing to html2pdf is correct.

also instead of

$html2pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8');

try using

$html2pdf = new HTML2PDF('P', 'A4', 'he', true, 'UTF-8');

If that too does not work then this means that you are using incorrect version of html2pdf in this case i shall recommend you to use this fork

https://github.com/iafan/html2pdf/blob/master/_tcpdf_5.9.206/config/lang/heb.php

otherwise use some other library like FPDF

Solution 2:

Try using different font:

$html2pdf->setDefaultFont('dejavusans');

Post a Comment for "Converting Html 2 Pdf (php) Using Hebrew Returns "???""