I am using tDPDF to use unicode font. The problem is that i am creating my web page using xampp, testing on Raspberry Pi LAMP server and uploading on my server. All of them have different server document root address which it is causing an error on a unicode file(php). It has the following line
Xampp File
JavaScript
x
$ttffile='C:xampphtdocsapp-finalfpdf/font/unifont/Calibri.ttf';
I must change it to something that it will work to all my address, like
JavaScript
C:xampphtdocsapp-final
192.168.1.10/html/
172.20.10.1/www/
I tested the following but missing the folder in each machine(app-final, html, www, etc…)
JavaScript
$ttffile=$_SERVER["DOCUMENT_ROOT"] . "/fpdf/font/unifont/Calibri.ttf";
My links so far:
JavaScript
C:xampphtdocsapp-finalfpdf/font/unifont/Calibri.ttf
192.168.1.10/ html/ fpdf/font/unifont/Calibri.ttf
172.20.10.1/ www/ fpdf/font/unifont/Calibri.ttf
Advertisement
Answer
It was so simple
JavaScript
$ttffile= __DIR__ . "/Calibri.ttf";