So, I am trying to change the pdf template using php.
I looked around and found that most people use FPDI, and I tried.
So what I did was
include('pdf/fpdf.php'); include('pdf/fpdi.php'); // initiate FPDI $pdf = new FPDI(); // add a page $pdf->AddPage(); // set the sourcefile $pagecount = $pdf->setSourceFile('pdf/menu_blanka.pdf'); // import page 1 $template = $pdf->importPage($pagecount); // use the imported page as the template $pdf->useTemplate($template, 0,0,0);
And I constantly get this error "FPDF error: the template does not exist!".
Can you guys help me?
source share