dompdf character encoding UTF-8

后端 未结 11 2033
我在风中等你
我在风中等你 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:39

    Lots of answers here, struggled to get any to provide cross-language support reliably. I believe that for those of us making distributed software, there is also server-setting blocks which stop some functionality such as @import and src:url() in pdfdom automatically working to embed a font.

    The following solution has worked across many servers & locally hosted sites, and requires no command line access:

    1. Retrieve font you want to use as a .ttf (for language support including Cyrillic, Greek, Devanagari, Latin, and Vietnamese, we used Noto Sans with all optional languages checked)
    2. Run/build-in the following script and fire PDFBuilder_install_font_family() ONCE only (singular install)

    Gist for PDFBuilder_install_font_family(): https://gist.github.com/woodyhayday/f8dc36cc7ec922bc1894f33eb2b0e928

提交回复
热议问题