TCPDF - special characters (for example: •) displayed as a question mark for a character

I know that TCPDF supports special characters and several languages. I tried all the fonts provided. I want to generate PDF in UTF-8. I know that the included freeserif font probably includes the character in question. "•"

Here is my current constructor call:

$pdf=new MYPDF('P', 'mm', 'Letter', true, 'UTF-8', false);

Here is an example of a generated character:

$this->Cell(80,6.35,"• $POST[reportTitle]",0,0,'L',true);

I also tried replacing the character with its html code:

•

+3
source share
1 answer

As seen here :

Set the parameter $unicodein the TCPDF constructor to falseand $encodingto 'ISO-8859-1'or to another character map.

This will help you:

UTF-8:

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

:

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, false, 'ISO-8859-1', false);
+2

All Articles