function __construct(CTParametro $objParam) { $this->objParam = $objParam; $this->datos_reporte = array(); $this->firma = array(); $this->firmar = $this->objParam->getParametro('firmar'); $this->fecha_rep = $this->objParam->getParametro('fecha_firma'); $this->usuario_firma = $this->objParam->getParametro('usuario_firma'); $this->nombre_usuario_firma = $this->objParam->getParametro('nombre_usuario_firma'); $this->url_archivo = dirname(__FILE__) . "/../../../reportes_generados/" . $this->objParam->getParametro('nombre_archivo'); $this->nombre_archivo = $this->objParam->getParametro('nombre_archivo'); $this->titulo = $this->objParam->getParametro('titulo_archivo'); $this->orientacion = $this->objParam->getParametro('orientacion'); parent::__construct($this->orientacion, 'mm', $this->objParam->getParametro('tamano'), true, 'UTF-8', false); $this->SetTitle($this->titulo); $this->SetCreator('pXP'); $this->SetAuthor('kplian'); $this->SetSubject("File generated by pXP framework"); $this->SetKeywords("TCPDF, PDF, pXP"); }
/** * Nombre funcion: ReportePDF * Proposito: Constructor de la Función genérica de ReportePDF (Define el nombre del archivo, titulo, cabecera derecha y logo y pie) * Fecha creacion: 12/04/2009 * @param orientation Es la orientación el papel * @param formato es el formato del papel que puede ser A4 letter u otro * @param nom_archivo es el nombre del archivo ene l cual se genera el reporte * @param tit es el titulo del reporte * @param der define el texto que tendra la cabecera derecha del reporte * */ function __construct(CTParametro $objParam) { $this->objParam = $objParam; $this->url_archivo = dirname(__FILE__) . "/../../../reportes_generados/" . $this->objParam->getParametro('nombre_archivo'); $this->nombre_archivo = $this->objParam->getParametro('nombre_archivo'); $this->titulo = $this->objParam->getParametro('titulo_archivo'); $this->orientacion = $this->objParam->getParametro('orientacion'); $this->fecha_pie = 1; $this->setBarcode(date('d-m-Y H:i:s') . ",usuario:" . $_SESSION['_LOGIN']); $this->tipoReporte = $this->objParam->getParametro('tipoReporte'); //Ejecución del constructor del padre parent::__construct($this->orientacion, 'mm', $this->objParam->getParametro('tamano'), true, 'UTF-8', false); //Información del documento $this->SetCreator('pXP'); $this->SetAuthor('kplian'); $this->SetTitle($this->titulo); $this->SetSubject("File generated by pXP framework"); $this->SetKeywords("TCPDF, PDF, pXP, {$tit}"); //$this->SetProtection($permissions=array('print','copy','print-high','modify'), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null); $this->SetHeaderData($_SESSION['_DIR_LOGO'], PDF_HEADER_LOGO_WIDTH, $this->titulo, ''); $this->SetHeaderData($_SESSION['_DIR_LOGO'], PDF_HEADER_LOGO_WIDTH, $this->titulo, ''); //set header and footer fonts $this->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $this->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); //set default monospaced font $this->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $this->SetHeaderMargin(PDF_MARGIN_HEADER); $this->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $this->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $this->setImageScale(PDF_IMAGE_SCALE_RATIO); //Inicializa el array para numeración de columnas $this->arrNumeracion = array('label' => 'Nro.', 'name' => 'nro', 'width' => '65', 'type' => 'Field'); }