1

I am generating pdfs with DOMPDF library but It is not properly handling the symbol "≤". In the pdf output appears an "?"

I have read other StackOverflow questions and I already have the

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

inside the <head> block.

I am using these fonts:

body 
{
   font-family:  "Helvetica","Arial","sans-serif";
   font-size:12px;
   color:gray;
   margin: 0px;
   width: 100%;
}

Any idea?

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Adrián Rodriguez
  • 430
  • 11
  • 26
  • This is probably a font issue. Are you sure the font you're using in your PDF includes the `≤` character? Try using one of the DejaVu fonts or some other font with good support for Unicode and see if that helps. – ChrisGPT was on strike Sep 14 '16 at 12:17
  • This might be either a font issue or encoding issue. Which font are you using? And, regardless of the meta tag, in which encoding is this document encoded? – MC Emperor Sep 14 '16 at 13:16
  • The [Unicode How-To](https://github.com/dompdf/dompdf/wiki/UnicodeHowTo) might help. – BrianS Sep 14 '16 at 14:14
  • I am using "Helvetica","Arial","sans-serif": – Adrián Rodriguez Sep 16 '16 at 07:37
  • Do you know any font that support this character? I have read this answer: https://stackoverflow.com/questions/12140003/ascii-code-for-less-than-or-equal-to but i don't know if it is the only option I have – Adrián Rodriguez Sep 16 '16 at 07:40
  • If you're using 0.6.0 or newer you can, as mentioned by Chris, try one of the DejaVu fonts such as DejaVu Sans, e.g. ``. – BrianS Sep 16 '16 at 20:50
  • Off topic, but there should be no quotes around the `sans-serif`. It's a keyword, not a font name. Only font names should have quotes. (This won't be the solution to the problem though.) – Mr Lister Sep 19 '16 at 15:33
  • BrianS I am using Arial that has the ≤ character. – Adrián Rodriguez Sep 20 '16 at 07:03

0 Answers0