0

I have used wkhtmltopdf and barryvdh/laravel-snappy package in laravel version 10 for generate pdf reports and report is in Gujarati Shruti language. Issue is report works fine in local system but when we upload it on server it’s not displayed.

We also find that if we use php artisan serve command then it got dependencies what’s required to load fonts and working fine.

At server we can’t use php artisan serve command and that causing the problem.

$getevidence = $this->reportRepository->downloadReport($request);
$pdf = PDF::loadView('pages.Report.downloadReportNew', compact('getevidence'))->setPaper('a4')->setOrientation('portrait');
$current = Carbon::now()->format('YmdHs').'pdf.pdf';
$pdf->save(public_path('Report-data/').$current);

It should work with Gujarati Language

Ram Chander
  • 1,088
  • 2
  • 18
  • 36
Biren
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 04 '23 at 22:17

1 Answers1

0

Try adding your fonts Shruti in /public/fonts folder and add following css to it.

@font-face {
    font-family: 'Shruti';
    src: url('/fonts/Shruti.ttf') format('truetype');
}

body {
    font-family: 'Shruti', sans-serif;
}
Nehal
  • 1,004
  • 1
  • 10
  • 33