0

the issue I am facing is that I have Spanish Names stored in my table and as I fetch and print them with PHP, all names comes fine (with special (Spanish) letters), but if I write PDF using FPDF, the PDF shows such special letters either abnormally or in plain english.

I need to write Muñoz García in PDF but it is coming as plain text Munoz Garcia

I have tried solutions given at stackoverflow but none is working for me.

I have tried... utf-8, fpdf, iconv(), setlocale(), , but all waist.

Kindly help.

  • Does this answer your question? [FPDF utf-8 encoding (HOW-TO)](https://stackoverflow.com/questions/6334134/fpdf-utf-8-encoding-how-to) – Andrea Olivato Jul 24 '21 at 14:14
  • Please check especially the second answer – Andrea Olivato Jul 24 '21 at 14:14
  • FPDF utf-8 encoding (HOW-TO) – Andrea Olivato solutions helped a bit but not fully. – all mighty Jul 24 '21 at 15:28
  • Does this answer your question? [Special Characters in FPDF with PHP](https://stackoverflow.com/questions/3514076/special-characters-in-fpdf-with-php) – NcXNaV Jul 24 '21 at 16:44
  • If you use the standard fonts, UTF-8 strings must be converted to windows-1252. You can do it with `$str = iconv('UTF-8', 'windows-1252', $str);`. – Olivier Jul 25 '21 at 07:00

1 Answers1

0

FDFD output to the PDF encoded in ISO-8859-1 We need to use $pdf->Cell(0, 10, utf8_decode($text), 0, 1); use utf8_decode to make sure we send data in ISO-8859-1

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 03 '23 at 10:27