How can I use an generated image link in Dompdf?

  dompdf, php, symfony

When I put this link into my browser an image is downloaded:


When I am using the link on my page.html.twig Template like this:

<img src="http://localost:8888/manager/images/download/526" alt="image"/>

Then I see an image.

But if I use the same image link on my dompdf template I always get the message:

image not found or type unknown

I didn’t find a solution yet to make this work.

(It also does not work when I create a link that ends with jpg.)

I tried to add this code

  public function setRemoteOption()  {

And also this:

  $contxt = stream_context_create([
      'ssl' => [
        'verify_peer' => FALSE,
        'verify_peer_name' => FALSE,
        'allow_self_signed'=> TRUE


But it did not solve the problem

Source: Symfony Questions