I follow this tutorial https://transloadit.com/devtips/merging-pdf-documents-in-php-using-fpdi-and-fpdf/#install-fpdi-and-fpdf.
I installed packages by composer require setasign/fpdf:1.8.*
and then composer require setasign/fpdi:^2.0
.
Then I run in php -a
:
require 'vendor/autoload.php';
use setasignFpdiFpdi;
$pdf = new Fpdi();
It throws error “PHP Warning: Uncaught Error: Class “Fpdi” not found in php shell code:1″.
But directly $pdf = new setasignFpdiFpdi();
without using use
works. What is the reason?