PHPackages                             mathieutu/laravel-pdflayer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. mathieutu/laravel-pdflayer

ActivePackage[PDF &amp; Document Generation](/categories/documents)

mathieutu/laravel-pdflayer
==========================

A pdflayer API bridge for Laravel

2.0.1(8y ago)64.9k3[2 PRs](https://github.com/mathieutu/laravel-pdflayer/pulls)MITPHPPHP &gt;=7.0

Since Jan 4Pushed 5y agoCompare

[ Source](https://github.com/mathieutu/laravel-pdflayer)[ Packagist](https://packagist.org/packages/mathieutu/laravel-pdflayer)[ RSS](/packages/mathieutu-laravel-pdflayer/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (7)Used By (0)

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

[](#pdflayer-api-bridge-for-laravel-55-for-52-take-the-1-version)

[pdflayer.com](https://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.

[![Travis build](https://camo.githubusercontent.com/b5e41836c6ae1efd67de4d471f146d043bdec1d11daf25a0465370c6ab307cea/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d61746869657574752f6c61726176656c2d7064666c617965722f6d61737465722e7376673f7374796c653d666c61742d737175617265266c6162656c3d4275696c64)](https://travis-ci.org/mathieutu/laravel-pdflayer?branch=master)[![StyleCI](https://camo.githubusercontent.com/052e094913fad891302dfafb33476de4a3d6eb6a27bea59af750f5aaa7868734/68747470733a2f2f7374796c6563692e696f2f7265706f732f37373933313530332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/77931503)[![Test coverage](https://camo.githubusercontent.com/d16e4692c04653317a6a68c00df8144df61773d23f15832aed29b7d0db68f34c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d61746869657574752f6c61726176656c2d7064666c617965722e7376673f7374796c653d666c61742d737175617265266c6162656c3d436f766572616765)](https://scrutinizer-ci.com/g/mathieutu/laravel-pdflayer/?branch=master)[![Code quality](https://camo.githubusercontent.com/e6ceee6a6243c43f57a6d9e6fdaf428e537eb41b313e3f9018fb88e1284705f9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d61746869657574752f6c61726176656c2d7064666c617965722e7376673f7374796c653d666c61742d737175617265266c6162656c3d5175616c697479)](https://scrutinizer-ci.com/g/mathieutu/laravel-pdflayer/?branch=master)[![Packagist downloads](https://camo.githubusercontent.com/8de71fdbcfbe9545e472a0c90357af145adb1912b9305bbe1dcb482be3179805/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61746869657574752f6c61726176656c2d7064666c617965722e7376673f7374796c653d666c61742d737175617265266c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/mathieutu/laravel-pdflayer)[![Stable version](https://camo.githubusercontent.com/b8825d61c32402e8be1ebb53b4c64886664e3af582272dfd90b27fbcc5beb868/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61746869657574752f6c61726176656c2d7064666c617965722e7376673f7374796c653d666c61742d737175617265266c6162656c3d5061636b6167697374)](https://packagist.org/packages/mathieutu/laravel-pdflayer)

Installation
------------

[](#installation)

Require this package in your composer.json and update composer.

```
composer require mathieutu/laravel-pdflayer
```

Usage
-----

[](#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.

To create an new instance, you can use the `App` class, the `app()` helper, use the [facade](https://laravel.com/docs/5.5/facades), or (better) use [automatic dependency injection](https://laravel.com/docs/5.5/controllers#dependency-injection-and-controllers) :

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

You can chain the methods:

```
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](https://pdflayer.com/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.

```
$pdf->loadHTML('Hello!')->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.

### Configuration

[](#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:

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

### License and thanks

[](#license-and-thanks)

This PDFLayer Bridge for Laravel is an open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

The developer is not affiliated in any way with the [pdflayer.com](https://pdflayer.com) service.

This Readme and some methods of the `PDF` class are adapted from the [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf) package. Thanks to him for his job.

### Contributing

[](#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.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~141 days

Total

4

Last Release

3036d ago

Major Versions

1.0.1 → 2.0.02018-03-01

PHP version history (2 changes)1.0.0PHP &gt;=5.5

2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11351322?v=4)[Mathieu TUDISCO](/maintainers/mathieutu)[@mathieutu](https://github.com/mathieutu)

---

Top Contributors

[![mathieutu](https://avatars.githubusercontent.com/u/11351322?v=4)](https://github.com/mathieutu "mathieutu (2 commits)")

---

Tags

composerlaravelpdfpdf-converterpdflayerpdflayer-bridgephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mathieutu-laravel-pdflayer/health.svg)

```
[![Health](https://phpackages.com/badges/mathieutu-laravel-pdflayer/health.svg)](https://phpackages.com/packages/mathieutu-laravel-pdflayer)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.6M217](/packages/backpack-crud)[statamic/cms

The Statamic CMS Core Package

4.8k3.5M920](/packages/statamic-cms)[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
