derrickrozay
2 years ago
283
3
Laravel

How to open PDF in a new window instead of having to download it

Posted 2 years ago by derrickrozay

This is how I am currently making a PDF using the snappy wrapper

public function printPDF() {
       $records = Records::all('text', 'image');
        $pdf = SnappyPdf::loadView('records.print.dies', ["records" => $records]);
        return $pdf->download('record.pdf');
}

However this allows you to download it but I want it to open in a new browser window instead. How can this be done?

Please sign in or create an account to participate in this conversation.