Chinese and japanese characters available ininvoices pdf
This commit is contained in:
@ -14,8 +14,6 @@ use App\Jobs\Document\UpdateDocument;
|
||||
use App\Models\Document\Document;
|
||||
use App\Notifications\Sale\Invoice as Notification;
|
||||
use App\Traits\Documents;
|
||||
use Dompdf\Dompdf;
|
||||
use Dompdf\Options;
|
||||
|
||||
class Invoices extends Controller
|
||||
{
|
||||
@ -290,36 +288,21 @@ class Invoices extends Controller
|
||||
* @return Response
|
||||
*/
|
||||
public function pdfInvoice(Document $invoice)
|
||||
{
|
||||
define("DOMPDF_UNICODE_ENABLED", true);
|
||||
mb_internal_encoding('UTF-8');
|
||||
|
||||
$options = new Options();
|
||||
$options->set('defaultFont', 'Noto Sans');
|
||||
|
||||
$dompdf = new Dompdf($options);
|
||||
$dompdf->set_option('defaultMediaType', 'all');
|
||||
$dompdf->set_option('isFontSubsettingEnabled', true);
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
|
||||
|
||||
$file_name = $this->getDocumentFileName($invoice);
|
||||
|
||||
{
|
||||
event(new \App\Events\Document\DocumentPrinting($invoice));
|
||||
|
||||
$currency_style = true;
|
||||
|
||||
$view = view($invoice->template_path, compact('invoice', 'currency_style'))->render();
|
||||
|
||||
|
||||
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
|
||||
|
||||
$dompdf = app('dompdf.wrapper');
|
||||
|
||||
$dompdf->loadHTML($html, 'UTF-8');
|
||||
$file_name = $this->getDocumentFileName($invoice);
|
||||
|
||||
// return $pdf->download($file_name);
|
||||
$pdf = app('dompdf.wrapper');
|
||||
$pdf->loadHTML($html);
|
||||
|
||||
return $dompdf->stream();
|
||||
return $pdf->download($file_name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user