This is just a Dompdf wrapper!
I understand that this package is just a Laravel wrapper for https://github.com/dompdf/dompdf
Any issues with PDF rendering, CSS that is not applied correctly, aligning/fonts/characters etc that are not directly related to this package, should be reported there. When having doubts, please try to reproduce the issue with just dompdf. If it's also present there, do not open an issue here please.
Describe the bug
Calling $pdf->save() before ->stream() or ->download() on a document with custom loaded external fonts break them in the streaming/downloading, but does not break them in the file stored via ->save()
To Reproduce
Steps to reproduce the behavior:
using "barryvdh/laravel-dompdf": "^2.0", on laravel 10
have this simple html:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>I am used for dompdf font size calculation.</title>
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Trocchi&display=swap" rel="stylesheet">
</head>
<body>
<span style="font-family:'Trocchi';">I have a custom font</span>
</body>
load it, $pdf = Pdf::loadView('demo');
render it return $file->stream(); - now you should see it with a proper font
Now before doing the $file->stream(), save it to some random file, like $pdf->save( storage_path('demo.pdf'));
Streamed file fonts are not working now, while the file that has been saved via ->save() has all correct fonts
This is just a Dompdf wrapper! I understand that this package is just a Laravel wrapper for https://github.com/dompdf/dompdf Any issues with PDF rendering, CSS that is not applied correctly, aligning/fonts/characters etc that are not directly related to this package, should be reported there. When having doubts, please try to reproduce the issue with just dompdf. If it's also present there, do not open an issue here please.
Describe the bug Calling
$pdf->save()
before->stream()
or->download()
on a document with custom loaded external fonts break them in the streaming/downloading, but does not break them in the file stored via->save()
To Reproduce Steps to reproduce the behavior:
using
"barryvdh/laravel-dompdf": "^2.0",
on laravel 10have this simple html:
$pdf = Pdf::loadView('demo');
return $file->stream();
- now you should see it with a proper font$file->stream()
, save it to some random file, like$pdf->save( storage_path('demo.pdf'));
->save()
has all correct fontsExpected behavior fonts working