https://github.com/infoway9/laravel-mpdf
mPDF package for Laravel 5+
https://github.com/infoway9/laravel-mpdf
laravel laravel-5-package mpdf php
Last synced: 5 months ago
JSON representation
mPDF package for Laravel 5+
- Host: GitHub
- URL: https://github.com/infoway9/laravel-mpdf
- Owner: infoway9
- License: mit
- Created: 2019-01-14T09:37:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T11:34:41.000Z (over 7 years ago)
- Last Synced: 2025-06-15T11:04:35.009Z (about 1 year ago)
- Topics: laravel, laravel-5-package, mpdf, php
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel mPDF: mPDF wrapper for Laravel 5+
> Generate PDF documents from raw HTML or laravel blade file using the laravel
## Installation
Require this package in your `composer.json` or install it by running:
```
composer require infoway9/laravel-mpdf
```
> Note: This package supports auto-discovery features of Laravel 5.4+, You only need to manually add the service provider and alias if working on Laravel version lower then 5.5
To start using Laravel, add the Service Provider and the Facade to your `config/app.php`:
```php
'providers' => [
// ...
Infoway\mPdf\mPdfServiceProvider::class
]
```
```php
'aliases' => [
// ...
'PDF' => Infoway\mPdf\Facades\Pdf::class
]
```
Now, you should publish package's config file to your config directory by using following command:
```
php artisan vendor:publish --tag=laravel-mpdf
```
## Basic Usage
This is the basic usage of this package.
```php
'bar'
];
PDF::loadView('pdf',$data)->download('abc.pdf');
}
}
```
## Other methods
All available methods of `pdf` object are:
`output()`: Outputs the PDF as a string.
`save($filename)`: Save the PDF to a file
`download($filename)`: Make the PDF and download it.
`stream($filename)`: Return a response with the PDF to show in the browser.
## License
Laravel PDF is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)