TCPDF UTF-8 symbols not showing up
Set the $unicode
parameter on the TCPDF constructor to false
and the $encoding
parameter to 'ISO-8859-1'
or some other character map.
This will help you:
Default for UTF-8 unicode:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
Example of constructor for European charset:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, false, 'ISO-8859-1', false);
TCPDF UTF-8 Japanese File Name Not Showing up
I resolved this.
In 'tcpdf.php' file: i was comment from line 7559 to 7562
public function Output($name='doc.pdf', $dest='I') {
...
//if ($dest[0] != 'F') {
//$name = preg_replace('/[\s]+/', '_', $name);
//$name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name);
//}
...
}
Reference library doc: tcpdf
TCPDF is not showing Unicode from MySQL database
I have solved my issue using mPDF. It's quite easy to use compared to TCPDF.
TCPDF HTML with Special Characters displays empty PDF file
before line $pdf->writeHTML
$html = utf8_decode($html);
maybe
$html = utf8_encode($html);
Related Topics
When Do I Have to Declare Session_Start();
Can't Insert Chinese Character into MySQL
"PHP Fatal Error: Class 'Httprequest' Not Found"
Can PHP's Glob() Be Made to Find Files in a Case Insensitive Manner
Bind_Param Number of Variables Doesn't Match Number of Parameters in Prepared Statement
PHP - Convert File System Path to Url
Passing Data from Controller to View in Laravel
What Is the Fastest Xml Parser in PHP
Strip Tags and Everything in Between
Edit Google Calendar Events from Google Service Account: 403
PHP Error: Function Name Must Be a String
Laravel Tokenmismatchexception in Ajax Request
Get All MySQL Selected Rows into an Array
What Is Better in a Foreach Loop... Using the & Symbol or Reassigning Based on Key