Download the PHP package laravel-enso/pdf without Composer
On this page you can find all versions of the php package laravel-enso/pdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-enso/pdf
More information about laravel-enso/pdf
Files in laravel-enso/pdf
Package pdf
Short Description PDF for Laravel Enso
License MIT
Homepage https://github.com/laravel-enso/pdf
Informations about the package pdf
Description
Pdf provides a small Laravel Enso wrapper around Snappy / wkhtmltopdf for generating PDF documents from Blade views.
The package exposes a fluent Pdf service that applies Enso's default page settings, loads a view with data, and then lets the caller inline, download, save, or output the rendered PDF.
It is used across the ecosystem for invoices, orders, delivery notes, stock documents, and other printable documents that need a consistent PDF pipeline.
Installation
Install the package:
The package relies on barryvdh/laravel-snappy, which in turn requires a working wkhtmltopdf binary in the target environment.
No additional provider registration is needed beyond Composer's package discovery.
Features
- Wraps
barryvdh/laravel-snappyin a small fluent service. - Loads Blade views with arbitrary data before rendering.
- Streams PDFs inline in the browser.
- Supports file download responses.
- Supports saving generated PDFs to disk.
- Exposes raw PDF output as a string.
- Ships with Enso defaults for paper size, margins, orientation, and footer pagination.
Usage
Generate a PDF from a Blade view:
Download instead of inlining:
Save the generated file:
Switch to landscape and override options when needed:
::: warning Note
This package is only a wrapper around Snappy. Rendering still depends on the availability and correctness of the underlying wkhtmltopdf binary in the running environment.
:::
API
Contracts
LaravelEnso\Pdf\Contracts\GeneratesPdfLaravelEnso\Pdf\Contracts\SavesPdf
GeneratesPdf defines:
inline(): Responseoutput(): string
SavesPdf defines:
save()
Pdf Service
LaravelEnso\Pdf\Services\Pdf
Public methods:
__construct()inline(string $filename = 'document.pdf'): Responseoutput(): stringsave($filename, $overwrite = false): PdfWrapperdownload(string $filename): Responselandscape(): selfsetOption(string $option, $value): selfloadView(string $view, array $attributes): self
Default options applied in the factory:
paper: a4orientation: portraitmargin-top: 10margin-left: 5margin-right: 5margin-bottom: 10footer-font-size: 8footer-center: "Page [page] from [toPage]"
Depends On
Framework dependency:
External dependencies:
Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!
All versions of pdf with dependencies
laravel/framework Version ^10.0|^11.0|^12.0|^13.0
php Version >=7.4