1

I'm having trouble printing specs because of special characters like:

Horn Coverage H ͦ x V ͦ: 90 ͦ H x 60 ͦV

50Hz ͠ 18kHz

Aside from utf8_decode, These are the codes I tried but still no luck:

$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);
                        
//$line = stripslashes($line);
//$line = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $line);
//$line =  iconv('UTF-8', 'windows-1252',$line);
                    
//setlocale(LC_CTYPE, 'en_US');
//$line = iconv('UTF-8', 'ASCII//TRANSLIT', $line);
//$pdf->AddFont('ArialMT','','arialn.php');
//$pdf->SetFont('ArialMT',null,10);
$pdf->MultiCell(100,4,''.$line,"L",'L',False);

Result_01:

enter image description here

Result_02:

enter image description here

Paul T.
  • 4,703
  • 11
  • 25
  • 29
Artour
  • 15
  • 3
  • 1
    If you use tFPDF (as your code suggests): use the UTF-8 string directly; you don't need any conversion. And, of course, the selected font must contain the characters. – Olivier Mar 10 '21 at 08:14
  • https://stackoverflow.com/questions/3514076/special-characters-in-fpdf-with-php/44341375#44341375 might be able to answer your question – ninjadouche Mar 12 '21 at 15:40

0 Answers0