Laravel Livewire Dompdf Preview

Viewed 27

I want to preview the dompdf in the browser. However, instead of previewing, livewire downloads the file.

$pdf = Pdf::loadView("template", compact('data'))->output();

return response()->streamDownload(
      fn () => print($pdf),
      "filename.pdf"
  );

I also tried this.

return Pdf::loadView("template", compact('data'))->stream();
0 Answers
Related