<?php
ob_start();
session_start();

require '../../../conexion.php';
require_once('../../../include/sesiones.php');
require "../../php_qr/qrlib.php";    
require_once dirname(__FILE__).'../../vendor/autoload.php';

$cot_id=$_GET['cot_id'];
$query=mysqli_query($con,"SELECT * FROM cotizacion where cot_id='$cot_id' ");
$roww=mysqli_fetch_array($query);
$cot_nombre=$roww['cot_nombre'];
$cot_n_cotizacion=$roww['cot_n_cotizacion'];

use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;

try {
    ob_start();
    include(dirname('__FILE__').'/cotizaciones/cotizacion8.php');
    $content = ob_get_clean();

    $html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', 0);
    $html2pdf->pdf->SetDisplayMode('fullpage');
    $html2pdf->writeHTML($content);
    $html2pdf->Output($cot_nombre.'-'.$cot_n_cotizacion.'.pdf', 'I');
} catch (Html2PdfException $e) {
    $html2pdf->clean();

    $formatter = new ExceptionFormatter($e);
    echo $formatter->getHtmlMessage();
}