<?php
/**
 * HTML2PDF Library - example
 *
 * HTML => PDF convertor
 * distributed under the LGPL License
 *
 * @package   Html2pdf
 * @author    Laurent MINGUET <webmaster@html2pdf.fr>
 * @copyright 2016 Laurent MINGUET
 *
 * isset($_GET['vuehtml']) is not mandatory
 * it allow to display the result in the HTML format
 */

    // get the HTML
    ob_start();
    include('laporan_cetak.php');

    $content = ob_get_clean();
    require __DIR__.'/vendor/autoload.php';
    
    use Spipu\Html2Pdf\Html2Pdf;
    try
    {
        $html2pdf = new HTML2PDF('L', array(215,330), 'fr', true, 'UTF-8', array(8, 10, 8, 10));
        $html2pdf->pdf->SetDisplayMode('fullpage');
        $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
        if(isset($_GET['id'])){
		$html2pdf->Output('Absensi'."-".$_GET['bulan'].$_GET['tahun']."-".$_GET['id'].".pdf");	
		}else{
		$html2pdf->Output('Absensi'."-".$_GET['bulan'].$_GET['tahun'].".pdf");	
		}
    }
    catch(HTML2PDF_exception $e) {
        echo $e;
        exit;
    }
	?>
