laravel-pdf
laravel-pdf copied to clipboard
Uninitialized string offset -72798
I have a form in the dashboard to upload a font by admin
I stored the font in public/fonts/pdf_font.ttf each time admin uploaded a new a renamed the uploaded font to the same name of the font which is pdf_font.ttf I did everything but I got one problem when the admin upload a new font I went to the preview page to check whether the font is working I got this error:
This problem went out when I refresh the page twice!
my code of the font:
public function update(PdfTemplateRequest $request)
{
PdfTemplate::updateOrCreate(
['template_id' => $request->template_id],
[
'pdf_form' => Purifier::clean($request->pdf_form),
'template_id' => $request->template_id
]
);
return redirect()->back();
}
config/pdf.php:
'custom_font_dir' => base_path('public/fonts/'),
'custom_font_data' => [
'graphik-arabic' => [
'R' => 'pdf_font.ttf',
'useOTL' => 0xFF,
'useKashida' => 75,
]
],