Reputation: 33
I am using this function to print payslip as PDF, it's working for English content but the client has his data in Arabic so instead of Arabic letters it displays "?????".
I tried many fonts that supports Arabic but it's still not working.
This is the controller function:
public function printPdf(Payslip $payslip)
{
$month_year = $payslip->month_year;
$employee = Employee::get();
PDF::setOptions([
'dpi' => 150,
'defaultFont' => 'arial', // A font that supports Arabic
'tempDir' => storage_path('temp')
]);
$pdf = PDF::loadview('backend.salary.payslip.pdf', $payslip->toArray(), $employee);
return $pdf->stream();
}
Upvotes: 0
Views: 123