2017 © Pedro Peláez
 

package laravel-pdflayer

A pdflayer API bridge for Laravel

image

mathieutu/laravel-pdflayer

A pdflayer API bridge for Laravel

  • Saturday, March 3, 2018
  • by mathieutu
  • Repository
  • 0 Watchers
  • 5 Stars
  • 772 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 36 % Grown

The README.md

PDFLayer API bridge for Laravel 5.5+ (for 5.2+ take the 1.* version)

pdflayer.com is an HTML to PDF conversion API for developers. This package is an unofficial bridge to use this api with the PHP Laravel framework., (*1)

Travis build StyleCI Test coverage Code quality Packagist downloads Stable version, (*2)

Installation

Require this package in your composer.json and update composer., (*3)

composer require mathieutu/laravel-pdflayer

Usage

You can create a new PDFLayer instance and load a HTML string, file, view name or even an url. You can save it to a file, stream (show in browser) or download., (*4)

To create an new instance, you can use the App class, the app() helper, use the facade, or (better) use automatic dependency injection :, (*5)

$pdf = App::make('pdflayer');
$pdf = app('pdflayer');
$pdf = PDF::anyMethod();
public function downloadPdf(MathieuTu\PDFLayer\PDF $pdf) {}

You can chain the methods:, (*6)

return $pdf->loadView('pdf.invoice', $data)->setPaper('a4', 'landscape')->save('/path-to/my_stored_file.pdf')->stream('download.pdf');

You can set all the parameters given by the pdflayer documentation by using the setXXX method where XXX is the parameter in StudlyCase, or just set the parameter (in original snake_case) as attribute of the object., (*7)

$pdf->loadHTML('<h1>Hello!</h1>')->setWatermarkInBackground(true);
$pdf->margin_top = 134;
$pdf->save('myfile.pdf');

If you need the output as a string, you can get the rendered PDF with the output() function, so you can directly send it by email, for example., (*8)

Configuration

The defaults configuration settings are set in config/pdflayer.php. Copy this file to your own config directory to modify the values. You can publish the config using this shell command:, (*9)

php artisan vendor:publish --provider="MathieuTu\PDFLayer\PDFLayerServiceProvider"

License and thanks

This PDFLayer Bridge for Laravel is an open-sourced software licensed under the MIT license., (*10)

The developer is not affiliated in any way with the pdflayer.com service., (*11)

This Readme and some methods of the PDF class are adapted from the barryvdh/laravel-dompdf package. Thanks to him for his job., (*12)

Contributing

Issues and PRs are obviously welcomed and encouraged, as well for new features than documentation. Each piece of code added should be fully tested, but we can do that all together, so please don't be afraid by that., (*13)

The Versions

03/03 2018

dev-master

9999999-dev

A pdflayer API bridge for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu TUDISCO

03/03 2018

2.0.1

2.0.1.0

A pdflayer API bridge for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu TUDISCO

01/03 2018

2.0.0

2.0.0.0

A pdflayer API bridge for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu TUDISCO

05/01 2017

1.0.1

1.0.1.0

A pdflayer API bridge for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu TUDISCO

04/01 2017

1.0.0

1.0.0.0

A pdflayer API bridge for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu TUDISCO