PHPackages                             smarterp-dev/pdf-template - 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. smarterp-dev/pdf-template

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

smarterp-dev/pdf-template
=========================

A Laravel package for creating PDF documents using mPDF with Khmer language support

v1.0.24(6mo ago)1751[3 issues](https://github.com/turbotechlabs/pdf-template/issues)MITPHPPHP ^7.4|^8.0CI passing

Since May 16Pushed 6mo agoCompare

[ Source](https://github.com/turbotechlabs/pdf-template)[ Packagist](https://packagist.org/packages/smarterp-dev/pdf-template)[ RSS](/packages/smarterp-dev-pdf-template/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (24)Used By (0)

[![](./src//images/pre.png)](./src//images/pre.png)

[![PHP Tests](https://github.com/turbotechlabs/pdf-template/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/turbotechlabs/pdf-template/actions/workflows/run-tests.yml)

PDF Template Package
====================

[](#pdf-template-package)

A Laravel package for generating PDF documents using mPDF with Khmer font support and custom templates.

Project Setup
-------------

[](#project-setup)

### Prerequisites

[](#prerequisites)

Before running tests or using the package, ensure you have:

1. Installed all dependencies:

    ```
    composer install
    ```
2. Created the required temporary directory for mPDF:

    ```
    mkdir -p temp/pdf
    ```

### Running Tests

[](#running-tests)

You can run the test suite using any of these methods:

- Using Composer script (recommended):

    ```
    composer test
    ```
- Running PHPUnit directly:

    ```
    vendor/bin/phpunit
    ```
- Running specific test suite:

    ```
    vendor/bin/phpunit --testsuite=Unit
    ```
- Running a specific test file:

    ```
    vendor/bin/phpunit tests/Unit/TemplateTest.php
    ```
- Running a specific test method:

    ```
    vendor/bin/phpunit --filter=it_can_get_config_with_default_values
    ```

### Test Coverage Report

[](#test-coverage-report)

To generate an HTML test coverage report, run:

```
composer test-coverage
```

This will create HTML reports in the `coverage` directory.

### Continuous Integration

[](#continuous-integration)

GitHub Actions workflow in [`.github/workflows/run-tests.yml`](.github/workflows/run-tests.yml) automatically runs tests across multiple PHP and Laravel versions on push or pull request.

### Extending Tests

[](#extending-tests)

When adding new features, please add corresponding tests in:

- Unit tests: `tests/Unit/`

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

[](#installation)

You can install the PDF Template package via [Packagist](https://packagist.org/packages/smarterp-dev/pdf-template):

### 1. Require the package via Composer

[](#1-require-the-package-via-composer)

Run the following command in your project root:

```
composer require smarterp-dev/pdf-template
```

### 2. Publish the package views (optional)

[](#2-publish-the-package-views-optional)

If you want to customize the PDF templates, you can publish the package's views to your Laravel application's resources directory:

```
php artisan vendor:publish --tag=views
```

This will copy the package views to `resources/views/vendor/smarterp-dev`.

To publish only the template views:

```
php artisan vendor:publish --tag=view-templates
```

This will copy the template views to `resources/views/vendor/smarterp-dev/templates`.

To publish example template views:

```
php artisan vendor:publish --tag=view-examples
```

This will copy example templates to `resources/views/vendor/smarterp-dev/templates/examples`.

### 3. Create the required temporary directory for mPDF

[](#3-create-the-required-temporary-directory-for-mpdf)

mPDF requires a writable temporary directory. Create it with:

```
mkdir -p temp/pdf
```

### 4. Configuration

[](#4-configuration)

The package will automatically register its service provider. No manual configuration is required for basic usage.

### 5. Ready to Use

[](#5-ready-to-use)

You can now use the package in your Laravel application. For usage examples and API documentation, refer to [docs/pdf.md](docs/pdf.md) and [docs/template.md](docs/template.md)

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance49

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98% 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 ~8 days

Total

23

Last Release

180d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/65fc1dd4bb2db8c1b195cfc26c5ee59defc1766c3378ea5a93e794893bbeb0aa?d=identicon)[smarterp-dev](/maintainers/smarterp-dev)

---

Top Contributors

[![pphatdev](https://avatars.githubusercontent.com/u/65520537?v=4)](https://github.com/pphatdev "pphatdev (144 commits)")[![turbotech-component](https://avatars.githubusercontent.com/u/137021824?v=4)](https://github.com/turbotech-component "turbotech-component (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/smarterp-dev-pdf-template/health.svg)

```
[![Health](https://phpackages.com/badges/smarterp-dev-pdf-template/health.svg)](https://phpackages.com/packages/smarterp-dev-pdf-template)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

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

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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