Generate a PDF invoice from a Laravel Blade template and trigger a browser download.
Create PDF/A-3b files with embedded XML for electronic invoicing standards like Zugferd or Factur-X.
Save generated PDFs to disk for later retrieval or email attachment.
Stream a PDF directly to the browser so users can view it without downloading.
Requires an existing Laravel or Lumen project, install via Composer and publish the config file.
This package connects Laravel, a popular PHP web framework, to Dompdf, a library that converts HTML into PDF files. The result is that Laravel developers can generate downloadable PDFs directly from their application's HTML templates without needing a separate PDF service or external API. The basic workflow is straightforward: you point the package at a Laravel view, which is an HTML template with data filled in, and it renders that view as a PDF. From there you can send the PDF directly to the browser for the user to view, trigger a file download, or save it to disk. A few lines of PHP code are enough to get started, and all major actions can be chained together in a single expression. Configuration options let you adjust paper size and orientation, set the resolution in DPI, control which fonts are used, and enable or disable features like remote image loading and JavaScript processing within the HTML. Remote access is turned off by default since version 3 for security reasons. Settings can be applied globally through a config file or changed individually for each PDF at runtime. The package also supports generating PDF/A-3b files, which is a stricter format designed for long-term archiving. This includes support for embedding XML attachments inside the PDF, which is required for electronic invoicing standards like Zugferd and Factur-X. Generating these compliant PDFs requires using embeddable fonts rather than the built-in core PDF fonts. For practical formatting, the package relies on standard CSS features already built into Dompdf: page breaks can be inserted between sections using the CSS page-break-after property, and UTF-8 character encoding is supported by including the appropriate meta tag in the HTML template. The package is installed via Composer and works with both full Laravel and the lighter Lumen variant of the framework.
← barryvdh on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.