Merge pull request #2244 from bengu-thon-mai-mochi/pdf-language-support
Invoices/Bills pdfs supports Japanese and Chinese chars
This commit is contained in:
commit
d78eb814f2
@ -288,12 +288,13 @@ class Invoices extends Controller
|
|||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function pdfInvoice(Document $invoice)
|
public function pdfInvoice(Document $invoice)
|
||||||
{
|
{
|
||||||
event(new \App\Events\Document\DocumentPrinting($invoice));
|
event(new \App\Events\Document\DocumentPrinting($invoice));
|
||||||
|
|
||||||
$currency_style = true;
|
$currency_style = true;
|
||||||
|
|
||||||
$view = view($invoice->template_path, compact('invoice', 'currency_style'))->render();
|
$view = view($invoice->template_path, compact('invoice', 'currency_style'))->render();
|
||||||
|
|
||||||
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
|
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
|
||||||
|
|
||||||
$pdf = app('dompdf.wrapper');
|
$pdf = app('dompdf.wrapper');
|
||||||
|
@ -78,7 +78,7 @@ return [
|
|||||||
/**
|
/**
|
||||||
* Whether to enable font subsetting or not.
|
* Whether to enable font subsetting or not.
|
||||||
*/
|
*/
|
||||||
"enable_font_subsetting" => false,
|
"enable_font_subsetting" => true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PDF rendering backend to use
|
* The PDF rendering backend to use
|
||||||
|
BIN
public/css/fonts/firefly_sung_normal.ttf
Normal file
BIN
public/css/fonts/firefly_sung_normal.ttf
Normal file
Binary file not shown.
@ -16,11 +16,25 @@
|
|||||||
<!-- Css -->
|
<!-- Css -->
|
||||||
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
|
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
|
||||||
|
|
||||||
|
@if (isset($currency_style) && $currency_style && in_array(app()->getLocale(), ['zh-CN', 'ja-JP', 'zh-TW']))
|
||||||
|
<style type="text/css">
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Firefly Sung';
|
||||||
|
font-weight: 'normal';
|
||||||
|
src: url('{{ asset("/public/css/fonts/firefly_sung_normal.ttf") }}') format("truetype");
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
font-family: 'Firefly Sung', sans-serif !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@else
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
* {
|
* {
|
||||||
font-family: DejaVu Sans, sans-serif !important;
|
font-family: DejaVu Sans, sans-serif !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@endif
|
||||||
|
|
||||||
@stack('css')
|
@stack('css')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user