I have an issue with displaying what ever on a PDF file when I change the font.
<?php
session_start();
include $_SERVER['DOCUMENT_ROOT'] . "/library/fpdf.php";
$pdf = new FPDF('P',"mm",'A4');
$pdf->AddPage();
$pdf->AddFont('DejaVu','','DejaVuSans-Bold.ttf',true);
$pdf->SetFont('DejaVu','',14);
foreach ($_SESSION['settings'] as $settings) {
$pdf->Cell(130,5,$settings,1,1);
}
$pdf->Output();
?>
I tried changing the font with other files and I just keep getting random errors like:
Warning: Unexpected character in input:
or
Parse error [my path to the ttf file]
Even if I don't print anything in the PDF just leave it blank , I still get an error due to the AddFont,
If I remove
$pdf->AddFont('DejaVu','','DejaVuSans-Bold.ttf',true);
$pdf->SetFont('DejaVu','',14);
and replace it with
$pdf->SetFont('Arial','',14);
it works fine.