1. Go to this page and download the library: Download jbreuer95/laravel-make-pdf library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jbreuer95 / laravel-make-pdf example snippets
return [
// Configuration options will go here
];
use Breuer\MakePDF\Facades\PDF;
Route::get('/', function () {
return PDF::view('view.name', [])->response();
});
use Breuer\MakePDF\Enums\Orientation;
PDF::landscape()
use Breuer\MakePDF\Enums\Format;
PDF::format(Format::A4)
use Breuer\MakePDF\Enums\Unit;
PDF::paperSize($height, $width) // Uses inches by default
PDF::paperSize(29.7, 21, Unit::CENTIMETER) // Uses centimeters and converts to inches
use Breuer\MakePDF\Enums\Unit;
PDF::margins($top, $right, $bottom, $left) // Uses inches by default
PDF::margins(2.54, 1.27, 2.54, 1.27, Unit::CENTIMETER) // Centimeters, converted to inches