PHPackages                             davidjr82/php-pdf-generator - 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. davidjr82/php-pdf-generator

ActiveLibrary

davidjr82/php-pdf-generator
===========================

Yet another php pdf generator package

1461↓100%1PHP

Since Jan 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/davidjr82/php-pdf-generator)[ Packagist](https://packagist.org/packages/davidjr82/php-pdf-generator)[ RSS](/packages/davidjr82-php-pdf-generator/feed)WikiDiscussions dev Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PHP wrapper for engines (pdflatex, pandoc) to generate PDF files
================================================================

[](#php-wrapper-for-engines-pdflatex-pandoc-to-generate-pdf-files)

This package is a wrapper for engines to make easier generate PDF files from PHP. PDFLatex is the default engine. Excelent pandoc engine will be also provided, so more output formats can be achiueved.

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

[](#requirements)

Software for the engine should be installed first. Default is pdflatex:

Faster but bigger: `sudo apt-get update``sudo apt-get install texlive-full poppler-utils`

Slower but smaller (manually selecting packages, for example): `sudo apt-get update``sudo apt-get install texlive-base texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-science texlive-fonts-recommended texlive-fonts-extra texlive-lang-english texlive-lang-spanish poppler-utils`

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

[](#installation)

You can install the package via composer:

```
composer require davidjr82/php-pdf-generator
```

Usage
-----

[](#usage)

### Example demo tex file:

[](#example-demo-tex-file)

```
    return (new PDFGenerator())->setTestRenderedSource()->showInBrowser('filename.pdf');
    return (new PDFGenerator())->setTestRenderedSource()->download('filename.pdf');
    return (new PDFGenerator())->setTestRenderedSource()->saveFile('filename.pdf');
```

### Example tex file:

[](#example-tex-file)

```
    $tex = file_get_contents('path/to/file.tex');

    return (new PDFGenerator())->setRenderedSource($tex)->showInBrowser('filename.pdf');
    return (new PDFGenerator())->setRenderedSource($tex)->download('filename.pdf');
    return (new PDFGenerator())->setRenderedSource($tex)->saveFile('filename.pdf');
```

### Example Laravel users:

[](#example-laravel-users)

```
    $view = view('path.to.blade', $data)->render();

    return (new PDFGenerator())->setRenderedSource($view)->showInBrowser('filename.pdf');
    return (new PDFGenerator())->setRenderedSource($view)->download('filename.pdf');
    return (new PDFGenerator())->setRenderedSource($view)->saveFile('filename.pdf');
```

### Testing

[](#testing)

I know, I know... in the todo list.

```
composer test
```

### To do list

[](#to-do-list)

- Tests
- Add pandoc library to generate PDF
- Allow more input and output formats with pandoc

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [David Jiménez](https://github.com/davidjr82)

Inspiration / Thanks to:
------------------------

[](#inspiration--thanks-to)

- (BSD license)
- (MIT license)
- (MIT license)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

17

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95% 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.

### Community

Maintainers

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

---

Top Contributors

[![davidjr82](https://avatars.githubusercontent.com/u/4275886?v=4)](https://github.com/davidjr82 "davidjr82 (19 commits)")[![ArturCapraro](https://avatars.githubusercontent.com/u/54982545?v=4)](https://github.com/ArturCapraro "ArturCapraro (1 commits)")

### Embed Badge

![Health badge](/badges/davidjr82-php-pdf-generator/health.svg)

```
[![Health](https://phpackages.com/badges/davidjr82-php-pdf-generator/health.svg)](https://phpackages.com/packages/davidjr82-php-pdf-generator)
```

PHPackages © 2026

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