Search code examples
phplaravelpdfpdf-generationwkhtmltopdf

Tablet stream (snappy)


Laravel 6.0+ https://github.com/barryvdh/laravel-snappy

here is my problem. I would like that on tablet I can print the pdf directly or then be able to stream the pdf as on the pc.

because currently on tablet I have to download the pdf, open the pdf, and print the pdf. I would like to simplify all that.

public function pdf()
{
    $order = Order::first()
    $pdf = PDF::loadView('admin/pdf.order', compact('order'));

    return $pdf->stream('Pdf_'. $order->num_order .'_'. $order->customer->name);

}

Thank you for your help.


Solution

  • I have found a solution to my problem I am going through an html basic view with a button in javascript which asks to print and which directly starts printing!