coupon-style PDF

0

I need to create a PDF-style coupon to send to a non-fiscal Daruma DR800 printer.

I need to know how to generate a custom size PDF and its contents. I already do PDF generation with DOMPDF in Laravel 5.5.

Example of how to generate any PDF:

public function printSimple($id)
{
    $sale = $this->sale::where('id', $id)->with('user', 'customer', 'products', 'promissory')->get()->first();
    $company = Company::find(1);
    $view = view('sale.print-simple', compact('sale', 'company'));
    $pdf = PDF::loadHTML($view)->setPaper('a4');
    return $pdf->stream();
}

Style this image:

    
asked by anonymous 05.04.2018 / 16:45

1 answer

1

You can move the paper size as follows:

 ->setPaper([0, 0, 807.874, 221.102], 'landscape')
    
05.04.2018 / 18:13