I`m using TCPDF class for making pdf file.
my code :
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$fontname = $pdf->addTTFfont('../common/pdf/fonts/persianFont/HiwebNazanin.ttf', 'TrueTypeUnicode', '', 32);
$pdf->SetFont($fontname, '', 12, '', 'false');
I want to change the default font to my font and addTTFfont method has been sugested in TCPDF docs. but I get this error!!
Fatal error: Call to undefined method TCPDF::addTTFfont() in ...
why I cant use it?!!
In TCPDF (Version 6.2.6) working with:
require_once('/your_path_to/tcpdf.php');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$fontname = TCPDF_FONTS::addTTFfont('../common/pdf/fonts/persianFont/HiwebNazanin.ttf', 'TrueTypeUnicode', '', 32);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With