X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/c3b42bba0c46c9510b6ca095dfab862ff97170e6..fe7e792266c5fe68f6e2cc70898eb45ef8e8424d:/lib/MECON/PDF/Marco.php?ds=sidebyside diff --git a/lib/MECON/PDF/Marco.php b/lib/MECON/PDF/Marco.php index 397a5ae..46d07e5 100644 --- a/lib/MECON/PDF/Marco.php +++ b/lib/MECON/PDF/Marco.php @@ -65,8 +65,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @var string $logo * @access public */ - var $logo = '/home/mmarrese/public_html/meconlib/www/images/pdf_logo.jpg'; - //@FIXME Ponener el path del logo por defecto + var $logo; /** * Paginador. @@ -102,14 +101,14 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @var string $string * @access public */ - var $titulo = true; + var $titulo; /** * SubTitulo. * @var string $subtitulo * @access public */ - var $subtitulo = true; + var $subtitulo; /** * Class constructor. @@ -121,11 +120,18 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access public */ function MECON_PDF_Marco($tam = "a4", $ori = "portrait") { - $this->_pdf =& new MECON_PDF; + $this->_pdf =& new MECON_PDF($tam); $this->_tamanio = $tam; $this->_orientacion = $ori; $this->_config = include 'MECON/PDF/Marco/medidas.php' ; $this->_config = $this->_config[$tam][$ori]; + if (@$this->_config['encabezado']['logo']['path']) { + $this->logo = $this->_config['encabezado']['logo']['path']; + } + $this->_config['Xi'] = $this->_pdf->config['Xi']; + $this->_config['Yi'] = $this->_pdf->config['Yi']; + $this->_config['Xf'] = $this->_pdf->config['Xf']; + $this->_config['Yf'] = $this->_pdf->config['Yf']; $this->MECON_HTML_Tabla(); } @@ -139,7 +145,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { $conf = $this->_config['encabezado']; if ($this->logo) { $this->_pdf->addImage($this->logo, $conf['logo']['X'], - $conf['logo']['Y'], null, 'jpg'); + $conf['logo']['Y'], null, 'jpg', $this->_orientacion); } } @@ -161,7 +167,8 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { } $init = $conf['linea1']['Xi'] + ( $conf['linea2']['Xi'] - $conf['linea1']['Xi'] - $tmp) / 2; - $this->_pdf->addText($init, $conf['seccion']['Y'], $this->seccion, $conf['seccion']); + $this->_pdf->addText($init, $conf['seccion']['Y'], $this->seccion, + $conf['seccion'], null, $this->_orientacion); } } @@ -184,7 +191,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { $init = $conf['linea1']['Xi'] + ( $conf['linea2']['Xi'] - $conf['linea1']['Xi'] - $tmp) / 2; $this->_pdf->addText($init, $conf['subseccion']['Y'], $this->subseccion, - $conf['subseccion']); + $conf['subseccion'], null, $this->_orientacion); } } @@ -203,7 +210,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { $init = $conf['linea2']['Xi'] + ( $conf['Xf'] - $conf['linea2']['Xi'] - $tmp) / 2; $this->_pdf->addText($init, $conf['paginador']['Y'], $txt, - $conf['paginador']); + $conf['paginador'], null, $this->_orientacion); } } @@ -223,7 +230,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { $init = $conf['linea2']['Xi'] + ( $conf['Xf'] - $conf['linea2']['Xi'] - $tmp) / 2; $this->_pdf->addText($init, $conf['fecha']['Y'], $this->fecha, - $conf['fecha']); + $conf['fecha'], null, $this->_orientacion); } } @@ -236,12 +243,14 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { function _addHeaderRectangle() { $conf = $this->_config['encabezado']; //Armo el recuadro - $this->_pdf->addRectangle ($conf['Yi'], $conf['Xi'], $conf['Yf'], - $conf['Xf']); + $this->_pdf->addRectangle ($conf['Xi'], $conf['Yi'], $conf['Xf'], + $conf['Yf'], '', null, $this->_orientacion); $this->_pdf->addLine($conf['linea1']['Xi'], $conf['linea1']['Yi'], - $conf['linea1']['Xf'], $conf['linea1']['Yf']); + $conf['linea1']['Xf'], $conf['linea1']['Yf'], '', null, + $this->_orientacion); $this->_pdf->addLine($conf['linea2']['Xi'], $conf['linea2']['Yi'], - $conf['linea2']['Xf'], $conf['linea2']['Yf']); + $conf['linea2']['Xf'], $conf['linea2']['Yf'], '', null, + $this->_orientacion); } /** @@ -254,15 +263,15 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { $conf = $this->_config['titulo']; if ($this->titulo) { $tmp = $this->_pdf->strlen($this->titulo, $conf); - $tmp2 = $this->_config['Xf'] + abs($this->_config['Xi']); + $tmp2 = $this->_pdf->getWidth($this->_orientacion); if ($tmp >= $tmp2) { $this->titulo = $this->_pdf->wrapLine ($this->titulo, $tmp2, $conf); $tmp = $this->_pdf->strlen($this->titulo, $conf); } - $init = $this->_config['Xi'] + ($tmp2 - $tmp) / 2; + $init = ($tmp2 - $tmp) / 2; $this->_pdf->addText($init, $conf['Y'], $this->titulo, - $conf); + $conf, null, $this->_orientacion); } } @@ -276,15 +285,15 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { $conf = $this->_config['subtitulo']; if ($this->subtitulo) { $tmp = $this->_pdf->strlen($this->subtitulo, $conf); - $tmp2 = $this->_config['Xf'] + abs($this->_config['Xi']); + $tmp2 = $this->_pdf->getWidth($this->_orientacion); if ($tmp >= $tmp2) { $this->subtitulo = $this->_pdf->wrapLine ($this->subtitulo, $tmp2, $conf); $tmp = $this->_pdf->strlen($this->subtitulo, $conf); } - $init = $this->_config['Xi'] + ($tmp2 - $tmp) / 2; + $init = ($tmp2 - $tmp) / 2; $this->_pdf->addText($init, $conf['Y'], $this->subtitulo, - $conf); + $conf, null, $this->_orientacion); } } @@ -310,8 +319,6 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { if ($subtitle) { $this->_addSubTitle(); } -// $this->_pdf->addLine($this->_config['Xi'], $this->_config['Yi'], -// $this->_config['Xf'], $this->_config['Yi']); } /** @@ -323,7 +330,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _getAvailableSpace($pagina) { - if ($pagina === 1) { + if ($pagina === 1 && $this->titulo && $this->subtitulo) { return $this->_config['contenido']['Y']; } else {