PHPackages                             yassin/ypdf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. yassin/ypdf

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

yassin/ypdf
===========

Y-PDF: Headless browser PDF generator for Laravel supporting full HTML/CSS/JS stacks.

v0.1.5(5mo ago)07MITPHPPHP ^8.1

Since Dec 8Pushed 5mo agoCompare

[ Source](https://github.com/Yassin3007/Y-PDF)[ Packagist](https://packagist.org/packages/yassin/ypdf)[ RSS](/packages/yassin-ypdf/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

Y-PDF
=====

[](#y-pdf)

A Laravel-ready package that uses a headless Chromium instance to render **full HTML, CSS, JavaScript, Bootstrap, Tailwind, and jQuery experiences** into pixel-perfect PDFs. Stop fighting traditional PHP PDF libraries that ignore styles — render the same markup your frontend already produces.

Highlights
----------

[](#highlights)

- Uses [chrome-php/chrome](https://github.com/chrome-php/chrome), so anything Chromium can paint (Vue, React, Livewire, Blade + Tailwind, etc.) will appear in the PDF.
- Simple API: `YPdf::renderFromView()` and `YPdf::renderFromHtml()` return binary data or save directly to disk.
- Configurable viewport, margins, background printing, sandbox flags, and custom wait strategies before capturing the PDF.
- Ships with a publishable config file so each project can point to its own Chromium binary, temp directory, and timeouts.
- Designed to live inside its own repository — drop this folder into a separate git repo, push to GitHub, and submit to Packagist. Afterwards, require it in any Laravel app with Composer.

Package Structure
-----------------

[](#package-structure)

```
packages/
└── imar/
    └── ypdf/
        ├── composer.json
        ├── config/ypdf.php
        ├── src/
        │   ├── Contracts/
        │   ├── Drivers/
        │   ├── Facades/
        │   ├── YPdfManager.php
        │   └── YPdfServiceProvider.php
        └── README.md

```

Installation (after publishing to Packagist)
--------------------------------------------

[](#installation-after-publishing-to-packagist)

```
composer require yassin/ypdf

# Install the headless Chrome adapter only if you plan to use it
composer require chrome-php/chrome

php artisan vendor:publish --tag=ypdf-config
```

Want to write your own driver or call a remote rendering API instead? Set `YPDF_DRIVER`to a custom driver name and bind an implementation of `YPdf\Contracts\PdfEngine` in a service provider—no Chromium dependency required.

Ensure Chromium is installed on the server, or point `HEADLESS_PDF_CHROME_BINARY` to a bundled binary. Example `.env` entries:

```
YPDF_CHROME_BINARY=/usr/bin/google-chrome-stable
YPDF_TEMP=/var/tmp/ypdf
YPDF_NO_SANDBOX=true

```

Usage
-----

[](#usage)

```
use YPdf;

// Render a Blade view straight to disk
YPdf::renderFromViewToFile('pdfs.invoice', ['order' => $order], storage_path('app/pdfs/order.pdf'));

// Grab the binary and stream it to the browser
return response(
    YPdf::renderFromHtml($html),
    200,
    ['Content-Type' => 'application/pdf']
);
```

Need to render an authenticated page? Generate a signed URL and call `YPdf::renderFromUrl($url)`.

Roadmap
-------

[](#roadmap)

- Additional drivers (Playwright, remote rendering service)
- Queued rendering + retry helpers
- HTML pre-processors for asset inlining and critical CSS extraction

Contributions welcome once the package is in its own repository!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance72

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

159d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5d406af1aafdc5e2409a21174a2b91f77bc67c985c6fb7e849ee9238d656a08?d=identicon)[Yassin3007](/maintainers/Yassin3007)

---

Top Contributors

[![Yassin3007](https://avatars.githubusercontent.com/u/103891306?v=4)](https://github.com/Yassin3007 "Yassin3007 (8 commits)")

### Embed Badge

![Health badge](/badges/yassin-ypdf/health.svg)

```
[![Health](https://phpackages.com/badges/yassin-ypdf/health.svg)](https://phpackages.com/packages/yassin-ypdf)
```

###  Alternatives

[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M339](/packages/yajra-laravel-datatables-oracle)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[moonshine/moonshine

Laravel administration panel

1.3k217.1k59](/packages/moonshine-moonshine)[laravel/folio

Page based routing for Laravel.

608453.9k27](/packages/laravel-folio)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
