Download the PHP package igeek/pdfservice without Composer
On this page you can find all versions of the php package igeek/pdfservice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download igeek/pdfservice
More information about igeek/pdfservice
Files in igeek/pdfservice
Package pdfservice
Short Description some desc
License MIT
Homepage https://github.com/coolamit/igeek-pdfservice
Informations about the package pdfservice
iGeek PdfService
A Laravel package for generating PDFs using Gotenberg. Convert Blade views or raw HTML to PDF with support for headers, footers, custom page sizes, and more.
If you do not have Gotenberg set up, you can quickly set it up using Docker. See coolamit/pdfservice to get started.
The API of this package is inspired by spatie/laravel-pdf (which is an excellent package by Spatie), but does not have a Node.js dependency and uses Gotenberg which is written in Golang.
Minimum Requirements
- PHP 8.3
- Laravel 11.x
- A running Gotenberg server
Installation
Install the package via Composer:
Publish the config file:
Configuration
Add these environment variables to your .env file:
Here the PDFSERVICE_URL is the URL where you can access your Gotenberg server and PDFSERVICE_API_KEY is the API key if you have authentication enabled.
The published config file (config/pdfservice.php):
Usage
Basic Usage with Blade Views
Using Raw HTML
Headers and Footers
Page Formats
Available formats: a0, a1, a2, a3, a4, a5, a6, letter, legal, tabloid
Custom Page Size
Set custom dimensions in inches [width, height]:
Orientation
Margins
Set margins in inches (top, right, bottom, left):
Note: When headers or footers are set and margins aren't explicitly defined, top/bottom margins automatically adjust to 1 inch.
Wait Delay
Control how long Chromium waits before capturing the PDF (useful for JavaScript-heavy content):
Storage Disk
Specify which Laravel filesystem disk to use for saving:
Blade Directives
Use these directives in your PDF Blade views:
Page Number
Page Break
Inline Images
Embed images as base64 from storage paths:
External URLs are passed through as is.
Output Methods
Save to Storage
Download Response
Inline Response
Display PDF in browser:
Get Raw Content
Custom API Credentials
Use different credentials to access Gotenberg API for specific operations:
Fluent Interface
All methods support chaining:
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
This package is released under MIT License (MIT). Please see License for more information.
All versions of pdfservice with dependencies
gotenberg/gotenberg-php Version ^2.15
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0