0

This is my code how to show Arabic font letters instead of question mark and font to include in pdf.
function

pdf_create($html, $filename, $stream=TRUE) 
    {
        require_once("dompdf/dompdf_config.inc.php");
        $date=date("m_d_Y");
        $filename = $filename.'_'.$date.'_'.rand();
        $dompdf = new DOMPDF();
        $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');   
        $dompdf->load_html($html);        
        $dompdf->render();
        $dompdf->stream("$filename".".pdf", array("Attachment" => false));
    } 

Immediate solution are appreiated.wait for solution from yester

Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
  • 1
    Check this may help you http://stackoverflow.com/questions/5136067/dompdf-special-characters – Keval Rathi Sep 03 '15 at 11:06
  • ok i check. Thank you. – Ezhilarasan Sep 03 '15 at 11:12
  • Will Helvetica font support for Arabic letters مساعدة like this or Any special font i have to download. – Ezhilarasan Sep 03 '15 at 11:24
  • Hi font-family: "Helvetica", sans-serif; when i use this font i am getting question mark how use this font in my dompdf – Ezhilarasan Sep 03 '15 at 11:59
  • FYI the core fonts only support characters from the Windows ANSI character set. In order to display characters from other encodings you have to use one of the included Deja Vu fonts (e.g. Deja Vu Sans) in dompdf 0.6.0 or greater or [load a custom font](http://stackoverflow.com/a/24517882/264628). – BrianS Sep 15 '15 at 22:45

1 Answers1

0

This code is working

In php page put below code in head. The issue was in my css font so only i got Arabic letters as ????? in pdf

<meta http-equiv="Content-Type" content="charset=utf-8"/>

In css

th
            {
                font-family: "DejaVu Sans Mono", monospace;
                /*font-family: "Helvetica", sans-serif;*/ This is wrong
                border: solid 1px black;
                font-size: 12px;
            }