- function _addSubTitle() {
- $conf = $this->_conf['subtitulo'];
- if ($this->subtitulo) {
- $tmp = $this->_pdf->strlen($this->subtitulo, $conf);
- $tmp2 = $this->_conf['Xf'] + abs($this->_conf['Xi']);
- if ($tmp >= $tmp2) {
- $this->subtitulo = $this->_pdf->wrapLine ($this->subtitulo, $tmp2,
- $conf);
- $tmp = $this->_pdf->strlen($this->subtitulo, $conf);
+ function toPDF() {
+ //Veo si hay que utilizar o no el header por defecto.
+ if (!$this->header) {
+ $this->_crearHeaderDefecto();
+ }
+
+ $this->_buildContent();
+ if ($this->getPages()) {
+ $t = true;
+ foreach ($this->getPages() as $page) {
+ $this->_pagina_actual = $page;
+
+ $sec = $this->header->seccion;
+ $subsec = $this->header->subseccion;
+
+ if (@$this->_excepciones[$this->numPage($page)]['seccion']) {
+ $this->header->seccion =
+ $this->_excepciones[$this->numPage($page)]['seccion'];
+ }
+
+ if (@$this->_excepciones[$this->numPage($page)]['subseccion']) {
+ $this->header->subseccion =
+ $this->_excepciones[$this->numPage($page)]['subseccion'];
+ }
+
+ if (@!$this->_excepciones[$this->numPage($page)]['nova']) {
+ $this->_buildHeader($t, $t);
+ }
+ //Solo agrego el titulo y subtitulo en la primer hoja
+ $t = false;
+
+ $this->header->seccion = $sec;
+ $this->header->subseccion = $subsec;