you can just use datatables buttons if your data to download is displayed on a table.
Oct 4, 2018
6
Level 1
want to create a pdf from the webpage created using dompdf
I have a webpage from where i want to transfer it to a pdf .But the issue is in my controller when i try to download it ,It says undefined variable which is the variable that was passed from another controller to the view so that the webpage gets generated.How will i access this variable or is there any other method. My Controller :
public function pdfview(Request $request)
{
if($request->has('download'))
{
$pdf = PDF::loadView('pdffileview');
return $pdf->download('pdfview.pdf');
}
}
This is how i passed from my view:
<a href="{{ route('pdfview',['download'=>'pdf']) }}">Download PDF report</a>
Plz have a look.Thanks in advance
Level 1
i am using the blade templates. Need to pass the variable new_records to the 'pdffileview' something like this
$pdf = PDF::loadView('pdffileview',compact('new_records'));
Thanks anyways.
1 like
Please or to participate in this conversation.