Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream not working in livewire #740

Closed
santhika29 opened this issue Dec 4, 2020 · 8 comments
Closed

stream not working in livewire #740

santhika29 opened this issue Dec 4, 2020 · 8 comments

Comments

@santhika29
Copy link

how to make pdf preview on livewire...
i'm using :
return $pdf->stream('invoice-pasien-pdf');
but nothing happen in my browser

@Kixell-NicolasJardillier

Hi @santhika29

here the solution :

return response()->streamDownload(function () {
            $pdf = App::make('dompdf.wrapper');
            $pdf->loadHTML('<h1>Test</h1>');
            echo $pdf->stream();
        }, 'test.pdf');

@olivsinz
Copy link

$pdfContent = PDF::loadView('view', $viewData)->output();
return response()->streamDownload(
     fn () => print($pdfContent),
     "filename.pdf"
);

@rvalle-dnota
Copy link

Hello , then if i want display in other page this pdf ¿how could it be?

@DavidNogara
Copy link

Hi @santhika29

here the solution :

return response()->streamDownload(function () {
            $pdf = App::make('dompdf.wrapper');
            $pdf->loadHTML('<h1>Test</h1>');
            echo $pdf->stream();
        }, 'test.pdf');

Thanks! that works, I was struggling with this error.

@djgraphics28
Copy link

return response()->streamDownload(function () {
$pdf = App::make('dompdf.wrapper');
$pdf->loadHTML('

Test

');
echo $pdf->stream();
}, 'test.pdf');

    this code ikeeps on download, how about print preview?

@djgraphics28
Copy link

return response()->streamDownload(function () {
$pdf = App::make('dompdf.wrapper');
$pdf->loadHTML('

Test

');
echo $pdf->stream();
}, 'test.pdf');

@sharifumasudi
Copy link

$pdf::writeHTML($html_content, true, false, true, false, '');

$pdf::Output('tb_patient_list_'.time().'.pdf', 'D');

I use TCPDF how can i print?
help

@juliusestebar
Copy link

how to add Encryption?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants