dompdf special characters

后端 未结 5 790
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 15:21

I\'m having successful html-to-pdf conversions, but not with special characters.

Below is just a special character I\'m trying to display, which displays in browsers

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-11 15:57

    DOMPDF Latin Turkish (Türkçe) char problem, my solution %100 Work.

    Server requirenment control:

    Char 'dejavu sans mono' (Turkish support) OR:

    Step 1: dompdf_config.inc.php edit to

    mb_internal_encoding('UTF-8');
    def("DOMPDF_UNICODE_ENABLED", true);
    

    Step 2: lib/fonts/dompdf_font_family_cache.dist.php edit to add code:

    'futural' => 
      array (
        'normal' => DOMPDF_FONT_DIR . 'FUTURAL',
        'bold' => DOMPDF_FONT_DIR . 'FUTURAL',
        'italic' => DOMPDF_FONT_DIR . 'FUTURAL',
        'bold_italic' => DOMPDF_FONT_DIR . 'FUTURAL',
      ),
    

    Step 3: doqnload font files to copy lib/fonts folder. Download font files Link http://www.2shared.com/file/k6hdky_b/fonts.html

    Step 4: Your code Edit example:

    require_once("dompdf_config.inc.php");
    $html='
    
    ';
    $html.='ı İ Ş ş ç Ç ö Ö ü Ü ğ Ğ ÿ þ ð ê ß ã Ù Ñ È »  ¿ İsa Şahintürk';
    $html.='';
    if ( isset( $html ) ) {
        if ( get_magic_quotes_gpc() )
        $html = stripslashes($html);
        $old_limit = ini_set("memory_limit", "16M");
        $dompdf = new DOMPDF();
        $dompdf->load_html($html,'UTF-8');
        $dompdf->set_paper('a4', 'portrait');// or landscape
        $dompdf->render();
        $dompdf->stream("limitless.pdf");
    exit(0);
    }
    

    End Finish PDF > exampleenter image description here http://limitsizbilgi.com/pdf/dompdf-chartest.pdf

提交回复
热议问题