diff --git a/views_pdf_plugin_style_table.inc b/views_pdf_plugin_style_table.inc index ec2fd7c..efa23b5 100644 --- a/views_pdf_plugin_style_table.inc +++ b/views_pdf_plugin_style_table.inc @@ -25,7 +25,6 @@ class views_pdf_plugin_style_table extends views_plugin_style { return $output; } - /** * Option definitions */ diff --git a/views_pdf_template.php b/views_pdf_template.php index 6bfa601..f98fec8 100644 --- a/views_pdf_template.php +++ b/views_pdf_template.php @@ -486,7 +486,6 @@ class PdfTemplate extends FPDI { $font_style = is_array($options['text']['font_style']) ? $options['text']['font_style'] : $this->defaultFontStyle; $textColor = !empty($options['text']['color']) ? $this->parseColor($options['text']['color']) : $this->parseColor($this->defaultFontColor); - $w = $options['position']['width']; $h = $options['position']['height']; $border = 0; @@ -578,11 +577,11 @@ class PdfTemplate extends FPDI { // Set draw point to the indicated position: if (empty($options['position']['x'])) { - $options['position']['x'] = 0; + $options['position']['x'] = $this->lMargin; } - + //Initial Y position. if (empty($options['position']['y'])) { - $options['position']['y'] = 0; + $options['position']['y'] = $this->tMargin; } if (isset($options['position']['last_writing_position']) && $options['position']['last_writing_position']) { @@ -604,7 +603,7 @@ class PdfTemplate extends FPDI { $sumWidth = 0; $numberOfColumnsWithoutWidth = 0; - // Set the definitiv width of a column + // Set the definitive width of a column. foreach ($columns as $id => $columnName) { if (isset($options['info'][$id]['position']['width']) && !empty($options['info'][$id]['position']['width'])) { $sumWidth += $options['info'][$id]['position']['width']; @@ -727,9 +726,10 @@ class PdfTemplate extends FPDI { // Get the page dimensions $pageDim = $this->getPageDimensions(); - if (($rowY + $this->bMargin + $options['position']['row_height']) > $pageDim['hk']) { - $rowY = $this->tMargin; + if (($rowY + $this->bMargin + $this->tMargin + $options['position']['row_height']) > $pageDim['hk']) { $this->addPage(); + $rowY = $this->tMargin; + } if ($this->lastWritingPage != $this->getPage()) {