I have been using custom font family for my arabic language in my pdf and it is working fine but the header and footer of the pdf doesnot take the font family that i am using in the pdf body. I have tried the following
$font_path = public_path('assets/fonts/droid-arabic-kufi-regular.ttf');
$pdf = \PDF::loadView($this->bladeName, $this->data);
$pdf->setOptions([
'enable-local-file-access' => true,
'enable-javascript' => true,
'javascript-delay' => 3000,
'enable-smart-shrinking' => true,
'no-stop-slow-scripts' => true,
'header-center' => __('jobs/jobs.system_generated_report'),
'footer-center' => __('jobs/jobs.risk_report'),
'footer-left' => __('jobs/jobs.confidential'),
'footer-right' => '[page]',
'debug-javascript' => true,
'header-font-name' => $font_path,
'footer-font-name' => $font_path,
]);
In blade file i have done the following in which the blade file is taking the font i have included.
@font-face {
font-family: 'Droid Arabic Kufi Regular';
src: url('data:font/ttf;base64,{{ base64_encode(file_get_contents(public_path('assets/fonts/droid-arabic-kufi-regular.ttf'))) }}') format('truetype');
}
Help Appreciated.
Also I have attached a portion of pdf snap below:
