Download the PHP package vaneetjoshi/laravel-pdf without Composer

On this page you can find all versions of the php package vaneetjoshi/laravel-pdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-pdf

Laravel PDF Builder

A fluent, pure-PHP PDF builder for Laravel.

Generating PDFs in PHP is traditionally a frustrating experience involving clunky syntax, massive configuration arrays, and layout limitations. This library changes that. It wraps the powerful mPDF engine in a beautiful, chainable Laravel API, making PDF creation an absolute breeze.

Beyond an incredible Developer Experience (DX), this package introduces a custom Two-Pass Letterhead Engine to solve the most complex layout limitations in modern PDF generation. It seamlessly renders full-page repeating borders, background canvases, and persistent headers/footers without triggering bounding-box collisions or margin collapse. Furthermore, it boasts built-in OTL (OpenType Layout) support to render complex Hindi/Sanskrit ligatures flawlessly.

Because it relies purely on PHP, this package is 100% shared-hosting friendly. No Node.js, Puppeteer, or headless browsers are required.


🌟 Why Choose This Library?

📋 Server Requirements


🚀 Installation

Install via Composer:

Publish the configuration file:


⚠️ CSS Limitations & Gotchas

Because this package wraps mPDF under the hood, it uses an older, specific HTML/CSS parsing engine. To avoid rendering headaches, please follow these rules:

  1. No Flexbox or CSS Grid: Do not use display: flex; or display: grid;. They will be ignored.
  2. Use Tables for Layouts: For columns and grids (like invoices), rely on classic HTML <table width="100%"> layouts.
  3. Header/Footer Fonts: mPDF detaches headers and footers from the main DOM. CSS classes defined in your <style> tags usually will not apply to headers. If you need a custom font in a header, use inline styles: <div style="font-family: devanagari, sans-serif;">.

🖋 Adding Custom Fonts

You can easily register your own fonts (like Poppins, Roboto, etc.) by placing the .ttf files in your designated font folder and mapping them in the published config/pdf.php file:

You can now use font-family: poppins, sans-serif; in your Blade views.


💻 Real-World Implementation Examples

1. Generating a Tax Invoice (Controller & Blade)

Here is a complete example of generating a professional, bordered invoice.

The Controller:

The Blade View (resources/views/pdf/invoice.blade.php):


2. Emailing a PDF Directly (Without Saving to Disk)

If you want to generate an invoice and email it to a customer immediately without cluttering your server's storage, use the output() method to get the raw binary data and attach it via Laravel's Mail facade.


3. Creating Complex Borders & Sanskrit Rendering

Perfect for Astrology Reports, Certificates, or intricate documents.


🛠 API Reference

Initialization & Configuration

Layout & Injection

Borders, Backgrounds & Security

Output Methods


📚 PdfBuilder Complete API Reference

All methods belong to the Vaneetjoshi\LaravelPdf\PdfBuilder class and can be chained via the Pdf Facade or pdf() helper function.


1. Instantiation & Core Configuration

__construct()


paperSize()


orientation()


margins()


displayMode()


2. Content & Styling Loaders

loadView()


loadHtml()


addStylesheet()


withSanskrit()


3. Headers, Footers & Pagination

headerHtml()


footerHtml()


showPageNumbers()


4. Two-Pass Backgrounds & Borders Engine

addEdgeBorder()


pageBackground()


5. Security & Watermarking

watermarkText()


watermarkImage()


protect()


6. Output Generators

stream()


download()


saveToDisk()


base64()


output()


All versions of laravel-pdf with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2 || ^8.3 || ^8.4 || ^8.5
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/view Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
mpdf/mpdf Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vaneetjoshi/laravel-pdf contains the following files

Loading the files please wait ...