LaravelPackages.net
Acme Inc.
Toggle sidebar
egoistdeveloper/laravel-fpdf

Laravel package to include Fpdf. It ships with Fpdf 1.84.

25
0
1.8.5
About egoistdeveloper/laravel-fpdf

egoistdeveloper/laravel-fpdf is a Laravel package for laravel package to include fpdf. it ships with fpdf 1.84.. It currently has 0 GitHub stars and 25 downloads on Packagist (latest version 1.8.5). Install it with composer require egoistdeveloper/laravel-fpdf. Discover more Laravel packages by egoistdeveloper or browse all Laravel packages to compare alternatives.

Last updated

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 egoistdeveloper/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();
    exit;

});

Defining fonts

FPDF comes with a set of fonts already defined and stored in the src/Fpdf/font directory. If you want to add your own font, please have a look at the Adding new fonts and encodings tutorial.

You can change the font path, by using the FPDF_FONTPATH environment variable.

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
Comments