I am trying to display Tamil content in PDF format using TFPDF. I have downloaded TSCu_SaiIndira.ttf, a Tamil font and stored it in the path C:\wamp\www\tfpdf\font\unifont
. The Tamil word stored in Notepad is 'பெயர்கள்'. When I run the code below, it is printed with different letters
<?php
require('tfpdf.php');
$pdf = new tFPDF();
$pdf->AddPage();
// Add a Unicode font (uses UTF-8)
$pdf->AddFont('DejaVu','','TSCu_SaiIndira.ttf',true);
$pdf->SetFont('DejaVu','',14);
// Load a UTF-8 string from a file and print it
$txt = file_get_contents('HelloWorld.txt');
$pdf->Write(8,$txt);
// Select a standard font (uses windows-1252)
$pdf->SetFont('Arial','',14);
$pdf->Ln(10);
$pdf->Write(5,'The file size of this PDF is only 12 KB.');
$pdf->Output();
?>
I am new to coding. I've read all the answers posted for the relevant questions but nothing is working out.