dompdf character encoding UTF-8

后端 未结 11 2030
我在风中等你
我在风中等你 2020-12-01 21:07

Im trying to create pdf with correct characters, but there are \"?\" chars. I created a test php file, where Im trying to fing the best solution. If Im open in the browser t

11条回答
  •  一整个雨季
    2020-12-01 21:44

    Chinese characters are causing problems sometimes. The important part is to have good font here is a list you can download.

    I chose first named "Kai Bold Font" here is a download page

    Then put it on your hosting service in a public folder. I put it into

    http://192.168.10.10/fonts/pdf/wts11.ttf
    

    and here is my html example

    $html = <<
    
    
       
       
    
    
        Chinese
        
    忠烈祠 中文 - 这工作
    hello world
    Russian - русский текст
    Greek - α,β,γ,δ,ε
    chars - !@#$%^&* -=- €


    Hebrew (iw)

    דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה

    EOT;

    PS. there is a little chance you might need this set:

    ini_set("allow_url_fopen", true);
    

提交回复
热议问题