barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.75k stars 974 forks source link

generated links not working on server #904

Open mavbcn opened 2 years ago

mavbcn commented 2 years ago

Hi everyone, I'm having some trouble with the link generation in my html > pdf files. Working local, there's no problema, I work with macOS and php 7.4. But on the server side, with ubuntu 20.04 and the same php 7.4 version the links are not rendered. heres the sample html I use to generate the pdf

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">    
</head>
<body>
    <a href="https://google.com">Test link</a>
</body>
</html>

and here's how I load the html to generate the Pdf

    $completePdf = PDF::loadHtml($completeHtml);
    $completePdf->setPaper('A4', 'Portrait');

    $completePdf->getDomPDF()->setHttpContext(
        stream_context_create([
            'ssl' => [
                'allow_self_signed'=> TRUE,
                'verify_peer' => FALSE,
                'verify_peer_name' => FALSE,
            ]
        ])
    );
   Storage::disk('local')->put('public'.'/' . $output_file_complete_pdf, $completePdf->output());

if I try to generate the pdf on local machine (macOS) works fine, but in the ubuntu server don't work at all I se the same html in the server to send an email with the link, and also works fine....

any ideas?

thanks so much

rakasindu1113 commented 2 years ago

I also have the same problem, have you found the solution?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.

timfrio commented 2 years ago

the first link on the a4 page is not clickable, and so on every page. although the field is not empty which comes

$pdf = PDF::loadView($view, ['data' => $data]); PDF::setOptions(['isJavascriptEnabled' => true]);

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.