I'm trying to extend FPDF with FPDI and TCPDF.
require('./fpdf/fpdf.php');
require('./tcpdf/tcpdf.php');
require('./fpdi/src/autoload.php');
$pdf = new \setasign\Fpdi\Fpdi();
...
$pdf->setSourceFile(...); // from FDPI
$pdf->ImageSVG(...); // from TCPDF
...
Which gives me
Fatal error: Uncaught Error: Call to undefined method setasign\Fpdi\Fpdi::ImageSVG()
I have tried this answer by:
require('./tcpdf/tcpdf.php');
require('./fpdi/src/autoload.php');
$pdf = new FPDI();
...
$pdf->setSourceFile(...); // from FDPI
$pdf->ImageSVG(...); // from TCPDF
...
And I get the error:
Fatal error: Uncaught Error: Class 'FPDI' not found
I also tried this answer by:
require('./tcpdf/tcpdf.php');
require('./fpdi/src/autoload.php');
$pdf = new \setasign\Fpdi\Fpdi();
...
$pdf->setSourceFile(...); // from FDPI
$pdf->ImageSVG(...); // from TCPDF
...
And I get the error:
Fatal error: Class 'FPDF' not found
Any guidance is appreciated.
FPDI comes with a class that already extends TCPDF:
require('./tcpdf/tcpdf.php');
require('./fpdi/src/autoload.php')
$pdf = new setasign\Fpdi\Tcpdf\Fpdi();
This is documented here.