Code Duplication    Length = 39-39 lines in 2 locations

web_interface/astpp/application/libraries/html2pdf/html2pdf.php 2 locations

@@ 2795-2833 (lines=39) @@
2792
                    break;
2793
            }
2794
2795
            if ( ! $this->parsingCss->value['position']) {
2796
                if (
2797
                    $w < ($this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin()) &&
2798
                    $this->pdf->getX() + $w >= ($this->pdf->getW() - $this->pdf->getrMargin())
2799
                    )
2800
                    $this->_tag_open_BR(array());
2801
2802
                if (
2803
                        ($h < ($this->pdf->getH() - $this->pdf->gettMargin() - $this->pdf->getbMargin())) &&
2804
                        ($this->pdf->getY() + $h >= ($this->pdf->getH() - $this->pdf->getbMargin())) &&
2805
                        ! $this->_isInOverflow
2806
                    )
2807
                    $this->_setNewPage();
2808
2809
                $old = $this->parsingCss->getOldValues();
2810
                $parentWidth = $old['width'] ? $old['width'] : $this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin();
2811
2812
                if ($parentWidth > $w) {
2813
                    if ($alignObject == 'center')        $this->pdf->setX($this->pdf->getX() + ($parentWidth - $w) * 0.5);
2814
                    else if ($alignObject == 'right')    $this->pdf->setX($this->pdf->getX() + $parentWidth - $w);
2815
                }
2816
2817
                $this->parsingCss->setPosition();
2818
            } else {
2819
                $old = $this->parsingCss->getOldValues();
2820
                $parentWidth = $old['width'] ? $old['width'] : $this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin();
2821
2822
                if ($parentWidth > $w) {
2823
                    if ($alignObject == 'center')        $this->pdf->setX($this->pdf->getX() + ($parentWidth - $w) * 0.5);
2824
                    else if ($alignObject == 'right')    $this->pdf->setX($this->pdf->getX() + $parentWidth - $w);
2825
                }
2826
2827
                $this->parsingCss->setPosition();
2828
                $this->_saveMax();
2829
                $this->_maxX = 0;
2830
                $this->_maxY = 0;
2831
                $this->_maxH = 0;
2832
                $this->_maxE = 0;
2833
            }
2834
2835
            if ($this->parsingCss->value['rotate']) {
2836
                $this->pdf->startTransform();
@@ 6073-6111 (lines=39) @@
6070
            $w = $this->parsingCss->value['width'];
6071
            $h = $this->parsingCss->value['height'];
6072
6073
            if ( ! $this->parsingCss->value['position']) {
6074
                if (
6075
                    $w < ($this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin()) &&
6076
                    $this->pdf->getX() + $w >= ($this->pdf->getW() - $this->pdf->getrMargin())
6077
                    )
6078
                    $this->_tag_open_BR(array());
6079
6080
                if (
6081
                        ($h < ($this->pdf->getH() - $this->pdf->gettMargin() - $this->pdf->getbMargin())) &&
6082
                        ($this->pdf->getY() + $h >= ($this->pdf->getH() - $this->pdf->getbMargin())) &&
6083
                        ! $this->_isInOverflow
6084
                    )
6085
                    $this->_setNewPage();
6086
6087
                $old = $this->parsingCss->getOldValues();
6088
                $parentWidth = $old['width'] ? $old['width'] : $this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin();
6089
6090
                if ($parentWidth > $w) {
6091
                    if ($alignObject == 'center')        $this->pdf->setX($this->pdf->getX() + ($parentWidth - $w) * 0.5);
6092
                    else if ($alignObject == 'right')    $this->pdf->setX($this->pdf->getX() + $parentWidth - $w);
6093
                }
6094
6095
                $this->parsingCss->setPosition();
6096
            } else {
6097
                $old = $this->parsingCss->getOldValues();
6098
                $parentWidth = $old['width'] ? $old['width'] : $this->pdf->getW() - $this->pdf->getlMargin() - $this->pdf->getrMargin();
6099
6100
                if ($parentWidth > $w) {
6101
                    if ($alignObject == 'center')        $this->pdf->setX($this->pdf->getX() + ($parentWidth - $w) * 0.5);
6102
                    else if ($alignObject == 'right')    $this->pdf->setX($this->pdf->getX() + $parentWidth - $w);
6103
                }
6104
6105
                $this->parsingCss->setPosition();
6106
                $this->_saveMax();
6107
                $this->_maxX = 0;
6108
                $this->_maxY = 0;
6109
                $this->_maxH = 0;
6110
                $this->_maxE = 0;
6111
            }
6112
6113
            $this->_drawRectangle(
6114
                $this->parsingCss->value['x'],