X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/f82ac09838f49891a683ca0cf345adf06b5e75f9..510e549ac73522250627fa1dba0b6ad46630d39a:/lib/MECON/PDF.php diff --git a/lib/MECON/PDF.php b/lib/MECON/PDF.php index b88e8a0..40fb3fe 100644 --- a/lib/MECON/PDF.php +++ b/lib/MECON/PDF.php @@ -36,7 +36,7 @@ class MECON_PDF { * @var arary $config * @access protected */ - var $config; + var $_config = array (); /** * Libreria externa. @@ -70,8 +70,8 @@ class MECON_PDF { function MECON_PDF($tam = "a4") { $this->_pdf = new pdffile; - $this->config = include 'MECON/PDF/medidas.php'; - $this->config = $this->config[$tam]; + $this->_config = include 'MECON/PDF/medidas.php'; + $this->_config = $this->_config[$tam]; } /** @@ -126,9 +126,9 @@ class MECON_PDF { * @return void * @access public */ - function addText($X, $Y, $texto, $estilo = '', $pag = null, $transformacion = - '') - { + function addText($X, $Y, $texto, $estilo = '', $pag = null, $transformacion = '') { + //@TODO Ver si $texto es un objeto + $x = $X; $y = $Y; switch (strtolower($transformacion)) { @@ -139,7 +139,7 @@ class MECON_PDF { case 'landscape': $X = $this->_landscapeX($x,$y); $Y = $this->_landscapeY($x,$y); - $estilo['rotation'] = 90; + @$estilo['rotation'] += 90; break; } $this->_pdf->draw_text($X, $Y, $texto, $this->refPage($pag), $estilo); @@ -363,10 +363,10 @@ class MECON_PDF { { switch (strtolower($orientacion)) { case 'landscape': - $width = $this->config['Yf'] - $this->config['Yi']; + $width = $this->_config['Yf'] - $this->_config['Yi']; break; default: - $width = $this->config['Xf'] - $this->config['Xi']; + $width = $this->_config['Xf'] - $this->_config['Xi']; } return $width; @@ -384,10 +384,10 @@ class MECON_PDF { { switch (strtolower($orientacion)) { case 'landscape': - $height = $this->config['Xf'] - $this->config['Xi']; + $height = $this->_config['Xf'] - $this->_config['Xi']; break; default: - $height = $this->config['Yf'] - $this->config['Yi']; + $height = $this->_config['Yf'] - $this->_config['Yi']; } return $height; } @@ -403,7 +403,7 @@ class MECON_PDF { */ function _landscapeX($x, $y) { - return -$y + $this->config['Xf']; + return -$y + $this->_config['Xf']; } /** @@ -417,7 +417,7 @@ class MECON_PDF { */ function _landscapeY($x, $y) { - return $x + $this->config['Yi']; + return $x + $this->_config['Yi']; } /** @@ -431,7 +431,7 @@ class MECON_PDF { */ function _portraitX($x, $y) { - return $x + $this->config['Xi']; + return $x + $this->_config['Xi']; } /** @@ -445,7 +445,7 @@ class MECON_PDF { */ function _portraitY($x, $y) { - return $y + $this->config['Yi']; + return $y + $this->_config['Yi']; } } ?> \ No newline at end of file