tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.24k stars 1.52k forks source link

Tamil UTF-8 Support Needed #609

Open HariharanUmapathi opened 1 year ago

HariharanUmapathi commented 1 year ago

I'm New to TCPDF Need to generate Pdf document with Tamil Language IN-ta Language Script Reference from Wikipedia https://en.wikipedia.org/wiki/Tamil_script

Issue Details :

UTF-8 Font Nirmala UI - Nirmala font is imported using tcpdf_add font utitlity

Some of the Text shows properly Some of the Text Is not Showing Properly in this issue preview you can see the font typed correctly

in the sample.pdf attached below has some font rendering issues PDF Content is also attached for your reference

sample.pdf

Image preview of the pdf

image any instructions to resolve this issue were welcome

`<?PHP define("TCPDF","E:\htdocs\TCPDF\examples"); //require_once TCPDF; //============================================================+ // File name : example_006.php // Begin : 2008-03-04 // Last Update : 2013-05-14 // // Description : Example 006 for TCPDF class // WriteHTML and RTL support // // Author: Nicola Asuni // // (c) Copyright: // Nicola Asuni // Tecnick.com LTD // www.tecnick.com // info@tecnick.com //============================================================+

/**

// Include the main TCPDF library (search for installation path). require_once(TCPDF.'\tcpdf_include.php');

// create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8' , true);

// set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Tamil PDF Content'); $pdf->SetTitle(' Tamil PDF Document'); $pdf->SetSubject('Tamil Lettters '); $pdf->SetKeywords('PDF'); //Font used here $pdf->setFont('nirmala'.'',14);

// set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

// set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

// set some language-dependent strings (optional) if (@file_exists(dirname(FILE).'/lang/eng.php')) { require_once(dirname(FILE).'/lang/eng.php'); $pdf->setLanguageArray($l); }

// add a page $pdf->AddPage(); $html = '

அ ஆ இ ஈ உ ஊ எ ஏ ஐ ஒ ஓ ஔ

க் ங் ச் ங ட் ண் த் ந் ப் ம் ய் ர் ற் ழ்

முத்திரை தாள் தமிழ் இணையக் கல்விக்கழகம்

க் க கா கி கீ கு கூ கெ கே கை கொ கோ ச ல் ல லா லி லீ லு லூ லெ லே லை லொ லோ தமிழ் இணையக் கல்விக்கழகம்

'; $pdf->writeHTML($html, true, false, true, false, '');

// reset pointer to the last page $pdf->lastPage();

//Close and output PDF document $pdf->Output('example_006.pdf', 'I');

//============================================================+ // END OF FILE //============================================================+ ?>`

Similar Issues

Ewa55 commented 1 year ago

I have the same problem with Khmer fonts