This tutorial is guide step by step procedure to generate PDF using anouar/fpdf  You can find the this package on packagist


  • Install package using composer in your project directory
  • Add service provider in app/config/app.php
  • Finally, add aliases in app/config/app.php
  • Now, Add your route
  • Serve the application

Now follow these steps:

For installation of package you can use this command:

composer require anouar/fpdf


Add the service provider in place:

'providers' => array(
	// ...



Add the aliases in you app configuration:

'aliases' => array(
	// ...

	'Fpdf'	  => AnouarFpdfFacadesFpdf::class,


Run the command if you have any error regarding class not found etc…

composer dump-autoload

Now place the example code your route named pdf in  web.php:

Route::get('pdf', function(){
	$fpdf = new Fpdf();
        $fpdf->Cell(40,10,'Hello World!');



Now, serve your project:

php artisan serve


Check the output on localhost:80/pdf.

Hope its help you ????