Looking to hire Laravel developers? Try LaraJobs

laravel-fpdf maintained by hectordufau

Description
Laravel package to include Fpdf. It ships with Fpdf 1.84.
Last update
2021/12/02 20:44 (dev-master)
License
Links
Downloads
25
Tags

Comments
comments powered by Disqus

Laravel package for Fpdf

Latest Stable Version Total Downloads StyleCI License

Using FPDF made easy with Laravel. See FPDF homepage for more information about the usage.

Installation using Composer

composer require hectordufau/laravel-fpdf

Configuration

Run
php artisan vendor:publish --provider="Codedge\Fpdf\FpdfServiceProvider" --tag=config
to publish the configuration file to config/fpdf.php.

Usage

// app/Http/routes.php | app/routes/web.php

Route::get('/', function (Codedge\Fpdf\Fpdf\Fpdf $fpdf) {

    $fpdf->AddPage();
    $fpdf->SetFont('Courier', 'B', 18);
    $fpdf->Cell(50, 25, 'Hello World!');
    $fpdf->Output();

});

Use in Laravel Vapor

If you want to use Laravel Vapor to host your application, a special header needs to be attached to each response that FPDF returns to your browser. To enable the use of this header, add the following environment variable to the Vapor environment file:

FPDF_VAPOR_HEADERS=true