Download the PHP package hamdallah90/easy-laravel-pdf without Composer
On this page you can find all versions of the php package hamdallah90/easy-laravel-pdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hamdallah90/easy-laravel-pdf
More information about hamdallah90/easy-laravel-pdf
Files in hamdallah90/easy-laravel-pdf
Package easy-laravel-pdf
Short Description easy-laravel-pdf: A Laravel package to generate PDF/images from views or HTML using Puppeteer in Docker for seamless integration.
License MIT
Homepage https://github.com/hamdallah90/easy-laravel-pdf
Informations about the package easy-laravel-pdf
Easy Laravel PDF
Overview
Easy Laravel PDF is a Laravel package that facilitates PDF generation within Laravel applications. This package utilizes a Node.js service, node-html-to-pdf
, which can be run locally or via Docker to convert HTML to PDF.
Installation
Prerequisites
- PHP 7.3 or higher
- Laravel 6.0 or higher
- Composer
- Node.js and npm (optional, if running the service locally without Docker)
- Docker (optional, for using Docker container)
Installing the Package
-
Add the Package via Composer:
- Publish Configuration: Laravel's package discovery will automatically register the service provider. To publish the package configuration, run:
Configuration
Edit the published configuration file in config/easy-laravel-pdf.php
to adjust settings like default PDF options.
Using the Package
EasyLaravelPdf
offers a variety of methods to generate PDF files. Here's how to use them in your Laravel applications:
Load and Render a View
Load HTML Content Directly
To load raw HTML content into the PDF generator:
URL To PDF
To Print url insted of send html or view:
Get the PDF as an UploadedFile
To get the PDF as an UploadedFile, which can be useful for testing or further manipulation:
Stream the PDF Directly to the Browser
To stream the PDF directly to the browser, which is useful for inline viewing:
Configuration and Customization
You can configure puppeteer options and launch arguments for more control over the PDF generation:
Node HTML to PDF Service
This service is essential for PDF generation and can be run locally or in a Docker container.
Running Locally
- Navigate to the
node-html-to-pdf
directory. -
Install dependencies:
- Start the server:
Running with Docker
-
Using the Dockerfile: Build the Docker image using the provided Dockerfile:
- Using the Pre-built Image: Alternatively, you can use a pre-built Docker image available on Docker Hub:
Support
For issues, feature requests, or contributions, please use the GitHub issues section for this repository.
All versions of easy-laravel-pdf with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0