0

I developed the resource to generate pdf using Lib DOMPDF in my system.

But it only works correctly when I'm in the DEV environment that uses HTTP, when I move to the Official environment that uses the SSL certificate generated by Let's Encrypt it breaks, the images and the style.css don't load.

The "src" of images and css is being passed the absolute path

I tried passing the parameters below, but it still didn't work.

    $options = new Options();
    $options->setChroot($projectPath);
    $options->isRemoteEnabled(true);

    $domPdf = new Dompdf($options);
    $domPdf->setBasePath($projectPath);
    
    $context = stream_context_create([
        'ssl' => [
            'allow_self_signed'=> TRUE,
            'verify_peer' => FALSE,
            'verify_peer_name' => FALSE,
        ]
    ]);      
    $domPdf->setHttpContext($context);
Kelvera
  • 15
  • 1
  • 6
  • Are the images in the CSS using `https://` (as https will refuse to load anything thats not secure)? – zanderwar Jan 20 '23 at 15:39
  • Please [edit] your question and include the code that shows exactly how you are including images and CSS. – Dave Jan 20 '23 at 18:11

0 Answers0