beyondplus / laravel-tcpdf by beyondplus

TCPDF Custom Font for Myanmar
153
1
2
Package Data
Maintainer Username: beyondplus
Maintainer Contact: sanpwintthu@hotmail.com (San Pwint Thu)
Package Create Date: 2017-03-23
Package Last Update: 2017-05-10
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-19 03:19:49
Package Statistics
Total Downloads: 153
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 1
Total Open Issues: 0

laravel-tcpdf

Custom Myanmar Font View PDF Generator

Requirement

laravel 5.4

Configure

Find config/app.php in Project Folder

'providers' => [
    //...
Elibyy\TCPDF\ServiceProvider::class,
BeyondPlus\TCPDF\TcpdfServiceProvider::class,
]
//...

'aliases' => [
    //...
'MMTCPDF'     => BeyondPlus\TCPDF\Facades\MMTCPDF::class,
]

Usage

use MMTCPDF;

At function

$fontname = MMTCPDF::font('Zawgyi-One');
//$fontname = MMTCPDF::font('Myanmar3');
MMTCPDF::SetFont($fontname , 11);
MMTCPDF::SetTitle('Record Report');
MMTCPDF::AddPage('P','A4');
MMTCPDF::writeHtml("Myanmar Words");
MMTCPDF::Output('report.pdf', 'I');

Example

$query = Database::get();
$fontname = MMTCPDF::font('Zawgyi-One');
MMTCPDF::SetFont($fontname , 11);
MMTCPDF::SetTitle('Record Report');
MMTCPDF::AddPage('P','A4');
MMTCPDF::writeHtml(view('pdf', array('records'=> $query)));
MMTCPDF::Output('report.pdf', 'I');
Margin
MMTCPDF::SetMargins(1, 1, 1);

Paper Size
MMTCPDF::AddPage ->
P = Portrait
L = Landscape

MMTCPDF::Output ->
F = localserver download
D = download
I = inline

$pagelayout = array('80', '210');
MMTCPDF::AddPage('P',$pagelayout);

// Background Image (width x height unit mm)
$img_file = public_path('upload/').'images.jpg';
MMTCPDF::setBgImage($img_file, 210, 148);

At the Blade Template

<span style="font-family:Zawgyi-One">ျမန္မာစာ</span>

Font Converter For Myanmar 3

php artisan vendor:publish
  • see the App/Http/helper.php function
  • integrate it at laravel autoload and use it

Refrence

License

The Beyond Plus Laravel TCPDF is open-sourced software licensed under the MIT license.

Website

www.beyondplus.biz