Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Laravel
  3. Laravel DOMPDF

Laravel DOMPDF

MITPHPv3.1.2

A Laravel wrapper for the Dompdf library to generate PDFs from HTML views, strings, or files.

GitHubGitHub
7.3k stars977 forks0 contributors

What is Laravel DOMPDF?

Laravel DomPDF is a wrapper package that integrates the Dompdf HTML-to-PDF converter into Laravel applications. It allows developers to generate PDF documents from HTML content, Blade views, or files directly within their Laravel projects, streamlining the creation of reports, invoices, and other printable documents.

Target Audience

Laravel developers who need to generate PDF documents from HTML content within their web applications, such as for invoices, reports, or user-facing documents.

Value Proposition

It provides a native Laravel experience with facades, service providers, and configuration files, eliminating the need to manually integrate Dompdf. The package also adds features like PDF/A-3b support for archival compliance and embedded XML attachments for electronic invoicing.

Overview

A DOMPDF Wrapper for Laravel

Use Cases

Best For

  • Generating invoices and receipts from Laravel applications
  • Creating printable reports from dynamic data in Blade templates
  • Producing PDF/A-3b compliant documents for archival purposes
  • Embedding XML invoices (e.g., Factur-X/Zugferd) into PDFs
  • Streaming PDFs directly to the browser for instant viewing
  • Customizing PDF output with configurable paper sizes, orientations, and fonts

Not Ideal For

  • Applications requiring high-performance, real-time PDF generation for thousands of documents
  • Projects needing advanced PDF features like fillable forms, digital signatures, or annotations
  • Teams working outside the Laravel ecosystem or with non-PHP tech stacks
  • Environments where strict font licensing or embedding is a concern for commercial PDF/A use

Pros & Cons

Pros

Native Laravel Integration

Provides a seamless Laravel experience with service providers, facades, and config files, making PDF generation feel like a built-in feature, as shown in the easy setup with `Pdf::loadView()`.

Flexible Input Sources

Supports generating PDFs from HTML strings, files, or Blade views with data binding, allowing developers to use existing templates effortlessly, demonstrated in the README examples.

PDF/A-3b Archival Support

Enables creation of compliant PDFs with embedded XML for electronic invoicing like Zugferd/Factur-X, detailed in the dedicated section with code snippets for `setPdfA()` and `addEmbeddedFile()`.

Configurable Output Options

Offers multiple output methods (stream, download, save) and per-instance settings like paper size and orientation, with chainable methods for convenience.

Cons

Font Management Complexity

For PDF/A compliance, core fonts aren't embedded, requiring manual setup with fonts like DejaVu, which adds overhead and potential licensing issues, as warned in the README.

Performance and Resource Usage

Relies on Dompdf engine, which can be slow and memory-intensive for large or complex documents, a known limitation not addressed in the wrapper.

Security Defaults Limitation

Remote resource loading is disabled by default in version 3.x, forcing extra configuration for external images or CSS, which might break existing workflows without careful handling.

Limited Advanced Features

Focuses on basic HTML-to-PDF conversion; lacks built-in support for interactive PDF elements or advanced manipulations, relying on Dompdf's capabilities.

Frequently Asked Questions

Quick Stats

Stars7,283
Forks977
Contributors0
Open Issues97
Last commit2 months ago
CreatedSince 2013

Tags

#hacktoberfest#reporting#html-to-pdf#pdf-a#dompdf#laravel#backend#php#pdf-generation#invoicing#pdf

Built With

P
PHP
L
Laravel

Included in

Laravel13.0k
Auto-fetched 8 hours ago

Related Projects

LiveWireLiveWire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.

Stars23,567
Forks1,745
Last commit11 hours ago
Debug BarDebug Bar

Debugbar for Laravel (Integrates PHP Debug Bar)

Stars19,277
Forks1,613
Last commit2 days ago
IDE HelperIDE Helper

IDE Helper for Laravel

Stars14,960
Forks1,194
Last commit18 days ago
Intervention ImageIntervention Image

PHP Image Processing

Stars14,369
Forks1,494
Last commit10 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub