Im attempting to use FPDF, on Windows and using the XAMPP server.
I keep running into this error:
Warning: include(helveticab.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\php\PEAR\fpdf.php on line 541
Warning: include() [function.include]: Failed opening 'helveticab.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\php\PEAR\fpdf.php on line 541 FPDF error: Could not include font metric file
Anyone have an idea of how this can be resolved?
Also, I have checked and helveticab.php is installed which is the answer given in similar questions that i looked at.
Thanks
Not sure why they did it, but if the font is "Arial" they change the font to Helvetica. One of the styles is "c". They append the style to the font, so it searches and adds the fonts and styles. Example is helvetica bold is helveticab, or helvetica italic bold is helveticabi, but helveticac does not exist. To circumvent this, I added the following lines in fpdf.php at around line 498. If the style is "c", we set the style to "": Code the already have
// Test if one of the core fonts
if($family=='arial')
$family = 'helvetica';
Code I added:
if(stripos($style, "c")!==false)
$style='';
I encountered the same problem but what solves it was I uploaded a folder in the program folder with name font. inside the font folder, I added the following files: helveticab.php, helvetica.php, helveticabi.php, helvetica-extracompressed.ttf, and helveticai.php Font folder can be downloaded from https://github.com/Setasign/FPDF. Just download all the files in https://github.com/Setasign/FPDF/tree/master/font and add them to your application.
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