barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.63k stars 290 forks source link

image is loading a blank page when including vuejs in blade #407

Closed farshadff closed 3 years ago

farshadff commented 4 years ago

i want to export a page as an image for user but when i add the vuejs to my blade file it just dont show the vuejs part : so my blade is like below :

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="/public/css/app.css">

</head>
<body>
<div id="app">
<payment-callback-certificate></payment-callback-certificate>
</div>
<script src="/public/js/app.js"></script>

</body>
</html>

and this is my controller :

     $pdf = SnappyImage::loadView('certificate', compact('data'));
        $pdf->setOption('run-script', 'window.setTimeout(function(){window.status="ready";},5000);');
        $pdf->setOption('enable-javascript', true);
        $pdf->setOption('javascript-delay', 5000);
        $pdf->setOption('no-stop-slow-scripts', true);
       return $pdf->download('invoice.jpg');

but this download s a blank image . if i add an h1 tag for example it appears in page but the vue js component is not loading here .

ghonchesefidi commented 4 years ago

Same problem here

stale[bot] commented 3 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/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy. If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.