<?php
namespace App\Controllers\Pdf;

use App\Controllers\BaseController;


class PrintPresupuestos extends BaseController
{
    function __construct()
    {

    }
    public function index()
    {

        //return view('pdf_view');
        return view(getenv('theme.path').'pdfs/presupuesto');
    }
    public function generar(){
        $dompdf = new \Dompdf\Dompdf(['isRemoteEnabled' => true]);
        //$dompdf->loadHtml(view('pdf_view'));
        $dompdf->loadHtml(view(getenv('theme.path').'pdfs/presupuesto'));
        $dompdf->setPaper('A4', 'portrait');
        $dompdf->render();
        $dompdf->stream('presupuesto-demo.pdf');
    }
}