<?php 

if($_REQUEST["txtFile"]!="") {

	$Orientation = $_REQUEST["txtOrientation"];
	
	if($Orientation=="")
		$Orientation="P";

	$filename= "../report/".$_REQUEST["txtFile"];
	
	$PDFFileName = str_replace(".html",".pdf",$filename);
	
	$html ="";
	
	$html = file_get_contents($filename);
	
	
	include("mpdf.php");
	
	//$codepage='win-1252',$format='A4',$default_font_size=0,$default_font='',$mgl=8,$mgr=5,$mgt=6,$mgb=6,$mgh=9,$mgf=9, $orientation='P'
	
	$mpdf=new mPDF(); 
	
	$mpdf->SetAutoFont(15);
	$mpdf->ignore_invalid_utf8=true;
	
	$mpdf->DefOrientation=$Orientation;
	
	$mpdf->showImageErrors = false;
	
	//$mpdf->useOnlyCoreFonts = false;	// false is default
	
	//$mpdf->AddPage('L');
	
	//$mpdf->WriteHTML(utf8_encode($html));

	$mpdf->WriteHTML($html);
	
	$mpdf->Output();

	unset($html);
	
	exit;
}
?>