PHPackages                             danteb918/livewire-pdf-preview - 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. danteb918/livewire-pdf-preview

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

danteb918/livewire-pdf-preview
==============================

Adds a component to easily preview livewire PDFs

1.0.2(1y ago)8301[2 issues](https://github.com/DanteB918/livewire-pdf-preview/issues)MITPHP

Since Dec 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DanteB918/livewire-pdf-preview)[ Packagist](https://packagist.org/packages/danteb918/livewire-pdf-preview)[ Docs](https://github.com/DanteB918/livewire-pdf-preview)[ RSS](/packages/danteb918-livewire-pdf-preview/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

[![GitHub release](https://camo.githubusercontent.com/35d85d54b5e134c39226500dfa9adfd26c73d809180b7a212238ca70a0e70ae4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f44616e7465423931382f6c697665776972652d7064662d707265766965772e737667)](https://github.com/DanteB918/livewire-pdf-preview/releases/)

Example
-------

[](#example)

[![livewire-pdf-preview-gif-2](https://private-user-images.githubusercontent.com/100642899/398460263-46649179-986c-47f8-90a2-d1a972f623f7.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5MTQ3ODIsIm5iZiI6MTc3MzkxNDQ4MiwicGF0aCI6Ii8xMDA2NDI4OTkvMzk4NDYwMjYzLTQ2NjQ5MTc5LTk4NmMtNDdmOC05MGEyLWQxYTk3MmY2MjNmNy5naWY_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jBhODVjOTQ1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.N0dgxYDwqMMI4aSZk9BjICwSLOZ70CvSmc2Ju2a9hgc)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require danteb918/livewire-pdf-preview
```

Please skip the next few installation steps if your application already has PDF.js installed.

Next, you must export the package public scripts. To do this run

```
php artisan livewire-pdf-preview:install
```

This command will export a `vendor/livewire-pdf-preview` folder under the `public` directory of your app which is used by the `@livewirePdfPreviewScripts` directive.

include the `@livewirePdfPreviewScripts` directive next to your other app scripts

```
@livewireScripts
@livewirePdfPreviewScripts
```

Requirements
------------

[](#requirements)

This package requires the following packages/libraries to work:

- `Laravel Livewire v3` ()
- `PDF.js` ()

Please follow each package/library instructions on how to set them properly in your project.

> Note: if you run the installation command and added the directives, that installs PDF.js.

Usage
-----

[](#usage)

You'll have a livewire component with an upload field, then the canvas, like so:

```

```

If you already have PDF.js in your application, you'll have to specify the `pdf.worker.js` path and pass it to the component. This is not required if that JS was set up via the command + `@livewirePdfPreviewScripts` method.

```

```

Be sure that your component has the `WithFileUploads` trait, if you are using Livewire file uploads. More information can be found [in the Livewire documentation.](https://livewire.laravel.com/docs/uploads#storing-uploaded-files)

It's preferred to always have the `key` attribute for this component so that it will re-render any time the PDF has been changed.

Contributing
------------

[](#contributing)

Feel free to open Pull requests with bug fixes and features. I'll do my best to keep an eye on those. Feel free to open issues with bug reports or feature requests. Bug fixes will take priority. I welcome contributions from the community and look forward to working with you to improve this project.

### Contributors

[](#contributors)

[ ![](https://camo.githubusercontent.com/606fbd4c4cce830d22464bc38755d34720af7473d446b181d709c76ee1c75394/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d44616e7465423931382f6c697665776972652d7064662d70726576696577)](https://github.com/DanteB918/livewire-pdf-preview/graphs/contributors)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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 ~4 days

Total

3

Last Release

493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30b7d3bd4d14d3bd0cd29383f27184e2ecf401d078464023d3d1786f64f429e1?d=identicon)[DanteB918](/maintainers/DanteB918)

---

Top Contributors

[![DanteB918](https://avatars.githubusercontent.com/u/100642899?v=4)](https://github.com/DanteB918 "DanteB918 (27 commits)")

---

Tags

laravellivewirepdfDanteB918livewire-pdf-preview

### Embed Badge

![Health badge](/badges/danteb918-livewire-pdf-preview/health.svg)

```
[![Health](https://phpackages.com/badges/danteb918-livewire-pdf-preview/health.svg)](https://phpackages.com/packages/danteb918-livewire-pdf-preview)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.2k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M100](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M128](/packages/openspout-openspout)[setasign/tfpdf

This class is a modified version of FPDF that adds UTF-8 support. The latest version is based on FPDF 1.85.

426.1M30](/packages/setasign-tfpdf)

PHPackages © 2026

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