Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started

barryvdh/laravel-dompdf v0.2.0

A DOMPDF Wrapper for Laravel
Package summary
Share
0
issues
0
licenses
Package created
23 Jun 2013
Version published
1 Aug 2013
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Error Generating Report

Frequently Asked Questions

What does barryvdh/laravel-dompdf do?

The barryvdh/laravel-dompdf is a Laravel wrapper for the Dompdf HTML to PDF Converter. It allows you to seamlessly convert your HTML content to PDF format within your Laravel applications. Whether you're looking to convert HTML strings, files, or even views, this package has you covered.

How do you use barryvdh/laravel-dompdf?

To begin using the barryvdh/laravel-dompdf package, you first need to include it in your project by running the command composer require barryvdh/laravel-dompdf.

For Laravel, after completing the installation, use the package in your code by invoking a new DOMPDF instance and loading your HTML content. Here's an example:

    use Barryvdh\DomPDF\Facade\Pdf;

    $pdf = Pdf::loadView('pdf.invoice', $data);
    return $pdf->download('invoice.pdf');

For Lumen, after updating composer add the following lines to register provider in bootstrap/app.php

    $app->register(\Barryvdh\DomPDF\ServiceProvider::class);
    // To change the configuration, copy the config file to your config folder
    $app->configure('dompdf');

You could also use the App container to generate a PDF from an HTML string, like so:

    $pdf = App::make('dompdf.wrapper');
    $pdf->loadHTML('<h1>Test</h1>');
    return $pdf->stream();

In addition to these, You can also save, stream, or download the converted PDF, change the paper size, orientation and more.

Where are the barryvdh/laravel-dompdf docs?

The detailed documentation of barryvdh/laravel-dompdf is provided directly inside the README of the GitHub repository at https://github.com/barryvdh/laravel-dompdf.git. It includes information on installation, usage, and configuration, also providing useful examples and tips. For additional configurations and options, check the config/dompdf.php file in your application, which will be created after running php artisan vendor:publish --provider="Barryvdh\DomPDF\ServiceProvider".