PHPackages                             soap/dompdf-thai - 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. soap/dompdf-thai

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

soap/dompdf-thai
================

Add Thai fonts for Laravel DomPdf wrapper package

v1.0.0(2y ago)03922MITPHPPHP ^7.4|^8.0|^8.1

Since Oct 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/soap/dompdf-thai)[ Packagist](https://packagist.org/packages/soap/dompdf-thai)[ Docs](https://github.com/soap/dompdf-thai)[ RSS](/packages/soap-dompdf-thai/feed)WikiDiscussions main Synced 1mo ago

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

Thai language support for barryvdh/laravel-dompdf package
=========================================================

[](#thai-language-support-for-barryvdhlaravel-dompdf-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6297ea11054b73b7cf967da10158dcc1d026002dd4d0daeca4e61f7fc22456e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f61702f646f6d7064662d746861692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soap/dompdf-thai)[![Total Downloads](https://camo.githubusercontent.com/ea69d931e61d62c4391e6f9a1efd511ada4c7163bf1c982ca33dbf100a4fd50e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f61702f646f6d7064662d746861692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soap/dompdf-thai)[![GitHub Actions](https://github.com/soap/dompdf-thai/actions/workflows/main.yml/badge.svg)](https://github.com/soap/dompdf-thai/actions/workflows/main.yml/badge.svg)

Add thai font support for barryvdh/laravel-dompdf package. Currently only THSanrabunNew is included.

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

[](#installation)

You can install the package via composer:

```
composer require soap/dompdf-thai
```

Publish the assets (font files) into public/vendor/dompdf-thai

```
php artisan vendor:publish --tag="dompdf-thai-assets"
```

Create storage/fonts to store cache files.

```
mkdir storage/fonts
```

Usage
-----

[](#usage)

Add @DompdfThaiFont inside head of your pdf view layout. You may put in resources/views/layouts/pdf.blade.php file. The following file was adapted from Laravel Breeze Guest layout file.

```

        {{ config('app.name', 'Laravel') }}

        @DompdfThaiFont
        @vite(['resources/css/app.css', 'resources/js/app.js'])

            body {
                font-family: 'THSarabunNew';
            }

                {{ $slot }}

```

The following file is in resources/views/products. This file will be used by ProductController to stream pdf content.

```

                    ทดสอบ This is a test for pdf

```

This is part of the product controller.

```
  namespace App\Http\Controllers;

  use App\Models\Product;
  use App\Http\Requests\StoreProductRequest;
  use App\Http\Requests\UpdateProductRequest;
  use Barryvdh\DomPDF\Facade\Pdf;

  ....
    /**
     * Remove the specified resource from storage.
     */
    public function destroy(Product $product)
    {
        //
    }

    public function toPdf()
    {
        $pdf = Pdf::loadView('products.pdf'); //, ['products' => Product::all()]);

        return $pdf->stream();
    }
```

Please consult the [barryvdh/laravel-dompdf documentation](https://github.com/barryvdh/laravel-dompdf) for detail how to produce pdf from Laravel view.

### Testing

[](#testing)

```
composer test
```

### 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)

- [Prasit Gebsaap](https://github.com/soap)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

951d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073690?v=4)[Prasit Gebsaap](/maintainers/soap)[@soap](https://github.com/soap)

---

Top Contributors

[![soap](https://avatars.githubusercontent.com/u/1073690?v=4)](https://github.com/soap "soap (7 commits)")

---

Tags

laravelpdfdompdfsoapfontthaidompdf-thai

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/soap-dompdf-thai/health.svg)

```
[![Health](https://phpackages.com/badges/soap-dompdf-thai/health.svg)](https://phpackages.com/packages/soap-dompdf-thai)
```

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

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

PHPackages © 2026

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