laravel-pdf icon indicating copy to clipboard operation
laravel-pdf copied to clipboard

Uninitialized string offset -72798

Open RabieAli95 opened this issue 3 years ago • 0 comments

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:

Screen Shot 2022-02-06 at 10 07 18 PM

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,
        ]
    ],

RabieAli95 avatar Feb 06 '22 20:02 RabieAli95