@jswoolf01 did you check the url (maybe a typo in the directory name) ?
<img class="logo" src="{{ url('/img/wba-pdf-logo-2024.png') }}" alt="logo" />
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
My current application includes a blade that generates HTML and turns it into a PDF via the DomPDF library. Unfortunately, it's refusing to display the company logo on the PDF as it's supposed to. The logo works fine on my local copy, but when pushed to the server staging copy or to production, the logo doesn't appear.
Here's the relevant bit of code:
<div class="row col-left w-40">
<img class="logo" src="{{url('/')}}/img/wba-pdf-logo-2024.png" />
</div>
<div class="row col-right w-65">
<div style="text-align: right;">
<h1 style="font-size: 28px;line-height: 28px;white-space: wrap;text-align:center;">
ITEM EVALUATION<br /><span style="text-align:center;"> and </span><br /> BILL OF SALE AGREEMENT</h1>
</div>
</div>
It's supposed to show up with the company logo on the left and the title on the right.
I've already confirmed that the image file is where it's supposed to be on the server. In fact there are two versions of it there, a jpg and a png. Neither one will display. I recently made some changes to the rest of the pdf, but left this snippet alone because it was working. Prior to these changes, the image did display. Now it doesn't. Can anyone here suggest some other fixes to try?
@jswoolf01 Maybe you can try with a inline base64 encoded image?
In your local server, you can convert your image to a base64 encoded string
$path = url('/img/wba-pdf-logo-2024.png');
$type = pathinfo($path, PATHINFO_EXTENSION); // here png
$data = file_get_contents($path);
$src = 'data:image/' . $type . ';base64,' . base64_encode($data);
// here 'data:image/png;base64,…………'
dd($src);
Then, in your template you can paste the full string:
<img src="... here the src as a string …">
Please or to participate in this conversation.