<?php
session_start();
include "verifica.php";

$parametro = $_REQUEST['parametro'];

?>
<?php //Ejemplo aprenderaprogramar.com
//$texto = file_get_contents("http://127.0.0.1/comercial2multiempresa_credito/aplantilla.php");
$texto = file_get_contents("http://127.0.0.1/comercial2multiempresa_credito/cotizacion_formato_pdf.php?id=".$parametro);

//echo $texto;
$html = $texto;
//$html = mb_convert_encoding($html, 'UTF-8', 'UTF-8'); 
$html = utf8_encode($html);

//$mpdf->WriteHTML(utf8_encode($html)); 

include("mpdf/mpdf.php");

$mpdf=new mPDF('c','A4','','',32,25,27,25,16,13); 

$mpdf->SetDisplayMode('fullpage');

$mpdf->list_indent_first_level = 0;	// 1 or 0 - whether to indent the first level of a list

// LOAD a stylesheet
//$stylesheet = file_get_contents('mpdfstyletables.css');
$stylesheet = file_get_contents('assets/css/pdf_formatos.css');
$mpdf->WriteHTML($stylesheet,1);	// The parameter 1 tells that this is css/style only and no body/html/text

$mpdf->WriteHTML($html,2);

$mpdf->Output('mpdf.pdf','I');
exit;

?>