I am trying to generate a PDF, if I created everything in the same directory there is no problem, the problem comes when I call the function that will generate this doc.
Warning: include (font / helveticab.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/lib/php/fpdf.php on line 1145
Warning: include (): Failed opening 'font / helveticab.php' for inclusion (include_path = '.: / Applications / XAMPP / xamppfiles / lib / php') in /Applications/XAMPP/xamppfiles/lib/php/fpdf.php on line 1145 FPDF error: Could not include font definition file
I get the feeling that calling it from another file and folder does not find that doc.
define('FPDF_FONTPATH','font/');
require_once('fpdf.php');
require_once('include/crud_usuario.php');
require_once('include/class_usuario.php');
$crud = new CrudUsuario;
$usuario = new Usuario;
$usuario = $crud->obtenerUsuario($_GET['id_usuario']);
And the function,
public function matricula(){
$pdf = new PDF;
$usuario = new Usuario;
/*antes de AddPage para que se apliquen los cambios*/
$pdf->SetTitle('Matricula - MC');
$pdf->SetLeftMargin(25);
$pdf->SetRightMargin(25);
/**/
$pdf->AddPage();
$y_axis_initial = 25;
$pdf->SetFont('Arial','B',12);
$pdf->Ln(10);
$pdf->InfoFicha($usuario);
/*Lo guardamos el PDF con dni de la persona*/
return $pdf->Output('matricula-'.$usuario->getDni().'.pdf','I');
}