nelisys/laravel-dompdf-thai-font

Adding Thai Fonts for Laravel Dompdf

v0.1.0 2021-01-17 09:43 UTC

This package is auto-updated.

Last update: 2024-04-17 16:43:15 UTC


README

This package is adding Thai fonts for barryvdh/laravel-dompdf to allow users can type Thai in generated PDF.

Installation

Run composer to install the package.

composer require nelisys/laravel-dompdf-thai-font

Publish the fonts files.

php artisan vendor:publish --provider="Nelisys\LaravelDompdfThaiFont\ServiceProvider"

Create storage/fonts to store cache files.

mkdir storage/fonts

Usage

Add @LaravelDompdfThaiFont inside <head>.

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
@LaravelDompdfThaiFont
<style>
body {
    font-family: 'THSarabunNew';
}
</style>
</head>
<body>
<h1>
    ทดสอบสร้าง PDF ภาษาไทย
</h1>
</body>
</html>

Related Links

License

Laravel Dompdf Thai Font is open-sourced software licensed under the MIT license.