![]() With dompdf 0.6.0 you can use the included Deja Vu fonts. So always be sure to style your text with a font that supports Unicode encoding and has the characters you need to display. How can I convert a Unicode (UTF-8) text file to PDF If you are using a Mac, it’s super easy: Open the file in TextEdit File > Print > PDF > Save as PDF Done Google Docs (sign in if necessary) Make a new blank document File > Open > Upload (choose the text file) File > Download As > PDF This works for many file types not just text files. If you do not specify a font then dompdf falls back to one of the core fonts (Helvetica, Times Roman, Courier) which only support Windows ANSI encoding. However the example was not meant to apply globally to any document, dompdf doesn't include firefly (a Chinese character font) or Verdana by default. It looks like you've read the how-to, because you're using the font example from that document. The main problem is that you don't specify a font that supports your characters. ![]() You should read over the Unicode How-to again. What Im doing wrong? I tried many many options which I found :( Any idea? $dompdf->set_paper('a4', 'portrait') // change these if you need toįile_put_contents($filename, $dompdf->output()) ![]() If Im open in the browser the html I looks like ok UTF-8 -> UTF-8 : X Ponuka číslo € černý Češkýīut when I look into the pdf I see this UTF-8 -> UTF-8 : X Ponuka ?íslo € ?erný ?ešký ![]() I created a test php file, where Im trying to fing the best solution. Im trying to create pdf with correct characters, but there are "?" chars.
0 Comments
Leave a Reply. |