<?php

require_once('pdf/pdf_js.php');

session_cache_limiter('private');
session_start();
$com = "I";
include("DMMYSQLG.php");
require_once("DF80000.php");

//Consulta Datos Empresa
$row_encabezado = mysqli_fetch_array(mysqli_query($con ,"SELECT * FROM dxempres where cla_emp = '".$_SESSION['empresa']."'"));
$cvdm = intval($row_encabezado['cve_delmun']);
$cves = intval($row_encabezado['cve_estado']);
//Consulta Datos Del/Mun
$rowd_encabezado = mysqli_fetch_array(mysqli_query($con ,"SELECT * FROM dxdelmun where cve_delmun = '".$cvdm."'"));
//Consulta Datos Estado 
$rowe_encabezado = mysqli_fetch_array(mysqli_query($con ,"SELECT * FROM dxestado where cve_estado = '".$cves."'"));

//include("DSA3000.php");x
    class PDF extends PDF_JavaScript{

  function Header()
	{
	  
		
		
	   
	}
	
	function AutoPrint($dialog=false){
		//Open the print dialog or start printing immediately on the standard printer
		$param=($dialog ? 'true' : 'false');
		$script="print($param);";
		$this->IncludeJS($script);
	}
	
	
	function AutoPrintToPrinter($server, $printer, $dialog=false){
		//Print on a shared printer (requires at least Acrobat 6)
		$script = "var pp = getPrintParams();";
		if($dialog)
			$script .= "pp.interactive = pp.constants.interactionLevel.full;";
		else
			$script .= "pp.interactive = pp.constants.interactionLevel.automatic;";
		$script .= "pp.printerName = '\\\\\\\\".$server."\\\\".$printer."';";
		$script .= "print(pp);";
		$this->IncludeJS($script);
	}
	function SendToDefaultPrinter($dialog=false,$printer="",$arrOpt=NULL){
		$script  = "var pp = getPrintParams();";
		$script .= "fv = pp.constants.flagValues;";
		$script .= "pp.flags |=(fv.suppressCenter|fv.suppressRotate);";
		$script .= "pp.pageHandling=pp.constants.handling.none;";		
		($dialog)?($script .= "pp.interactive = pp.constants.interactionLevel.full;"):($script .= "pp.interactive = pp.constants.interactionLevel.automatic;");
		//$script .= "this.print(pp);";
		$script .= "this.print(pp);";
		$this->IncludeJS($script);				
	}
	
	function GetPageWidth(){
		return $this->fw;
	}
	
	function GetPageHeight(){
		return $this->fh;
	}
	
	function GetRMargin(){
		return $this->rMargin;
	}
	function GetLMargin(){
		return $this->rMargin;
	}
	function GetTMargin(){
		return $this->rMargin;
	}
	function GetBMargin(){
		return $this->rMargin;
	}

}


$pdf=new PDF('P','mm','letter');
$pdf->SetMargins(6,0,12);
$pdf->SetAutoPageBreak(true,5);
$pdf->AddFont('verdana');
$pdf->SetFont('verdana','',6);
//ob_end_clean();
$pdf->Output("fac.pdf",'D');
?>
