src/Parsing/Css.php
public function setPosition()
    {
        // get the current position
        $currentX = $this->pdf->GetX();
        $currentY = $this->pdf->GetY();

        // save it
        $this->value['xc'] = $currentX;
        $this->value['yc'] = $currentY;

        if ($this->value['position'] === 'relative' || $this->value['position'] === 'absolute') {
            if ($this->value['right'] !== null) {
                $x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];
                if ($this->value['margin']['r']) {
                    $x-= $this->value['margin']['r'];
                }
            } else {
                $x = $this->value['left'];
                if ($this->value['margin']['l']) {
                    $x+= $this->value['margin']['l'];
                }
            }

            if ($this->value['bottom'] !== null) {
                $y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];
                if ($this->value['margin']['b']) {
                    $y-= $this->value['margin']['b'];
                }
            } else {
                $y = $this->value['top'];
                if ($this->value['margin']['t']) {
                    $y+= $this->value['margin']['t'];
                }
            }

            if ($this->value['position'] === 'relative') {
                $this->value['x'] = $currentX + $x;
                $this->value['y'] = $currentY + $y;
            } else {
                $this->value['x'] = $this->getLastAbsoluteX()+$x;
                $this->value['y'] = $this->getLastAbsoluteY()+$y;
            }
        } else {
            $this->value['x'] = $currentX;
            $this->value['y'] = $currentY;
            if ($this->value['margin']['l']) {
                $this->value['x']+= $this->value['margin']['l'];
            }
            if ($this->value['margin']['t']) {
                $this->value['y']+= $this->value['margin']['t'];
            }
        }

        // save the new position
        $this->pdf->SetXY($this->value['x'], $this->value['y']);
    }
public function setPosition()
    {
        // get the current position
        $currentX = $this->pdf->GetX();
        $currentY = $this->pdf->GetY();

        // save it
        $this->value['xc'] = $currentX;
        $this->value['yc'] = $currentY;

        if ($this->value['position'] === 'relative' || $this->value['position'] === 'absolute') {
            if ($this->value['right'] !== null) {
                $x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];
                if ($this->value['margin']['r']) {
                    $x-= $this->value['margin']['r'];
                }
            } else {
                $x = $this->value['left'];
                if ($this->value['margin']['l']) {
                    $x+= $this->value['margin']['l'];
                }
            }

            if ($this->value['bottom'] !== null) {
                $y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];
                if ($this->value['margin']['b']) {
                    $y-= $this->value['margin']['b'];
                }
            } else {
                $y = $this->value['top'];
                if ($this->value['margin']['t']) {
                    $y+= $this->value['margin']['t'];
                }
            }

            if ($this->value['position'] === 'relative') {
                $this->value['x'] = $currentX + $x;
                $this->value['y'] = $currentY + $y;
            } else {
                $this->value['x'] = $this->getLastAbsoluteX()+$x;
                $this->value['y'] = $this->getLastAbsoluteY()+$y;
            }
        } else {
            $this->value['x'] = $currentX;
            $this->value['y'] = $currentY;
            if ($this->value['margin']['l']) {
                $this->value['x']+= $this->value['margin']['l'];
            }
            if ($this->value['margin']['t']) {
                $this->value['y']+= $this->value['margin']['t'];
            }
        }

        // save the new position
        $this->pdf->SetXY($this->value['x'], $this->value['y']);
    }
public function setPosition ( ) { // get the current position $ currentX = $ this -> pdf -> GetX ( ) ; $ currentY = $ this -> pdf -> GetY ( ) ; // save it $ this -> value [ 'xc' ] = $ currentX ; $ this -> value [ 'yc' ] = $ currentY ; if ( $ this -> value [ 'position' ] === 'relative' || $ this -> value [ 'position' ] === 'absolute' ) { if ( $ this -> value [ 'right' ] !== null ) { $ x = $ this -> getLastWidth ( true ) - $ this -> value [ 'right' ] - $ this -> value [ 'width' ] ; if ( $ this -> value [ 'margin' ] [ 'r' ] ) { $ x -= $ this -> value [ 'margin' ] [ 'r' ] ; } } else { $ x = $ this -> value [ 'left' ] ; if ( $ this -> value [ 'margin' ] [ 'l' ] ) { $ x += $ this -> value [ 'margin' ] [ 'l' ] ; } } if ( $ this -> value [ 'bottom' ] !== null ) { $ y = $ this -> getLastHeight ( true ) - $ this -> value [ 'bottom' ] - $ this -> value [ 'height' ] ; if ( $ this -> value [ 'margin' ] [ 'b' ] ) { $ y -= $ this -> value [ 'margin' ] [ 'b' ] ; } } else { $ y = $ this -> value [ 'top' ] ; if ( $ this -> value [ 'margin' ] [ 't' ] ) { $ y += $ this -> value [ 'margin' ] [ 't' ] ; } } if ( $ this -> value [ 'position' ] === 'relative' ) { $ this -> value [ 'x' ] = $ currentX + $ x ; $ this -> value [ 'y' ] = $ currentY + $ y ; } else { $ this -> value [ 'x' ] = $ this -> getLastAbsoluteX ( ) + $ x ; $ this -> value [ 'y' ] = $ this -> getLastAbsoluteY ( ) + $ y ; } } else { $ this -> value [ 'x' ] = $ currentX ; $ this -> value [ 'y' ] = $ currentY ; if ( $ this -> value [ 'margin' ] [ 'l' ] ) { $ this -> value [ 'x' ] += $ this -> value [ 'margin' ] [ 'l' ] ; } if ( $ this -> value [ 'margin' ] [ 't' ] ) { $ this -> value [ 'y' ] += $ this -> value [ 'margin' ] [ 't' ] ; } } // save the new position $ this -> pdf -> SetXY ( $ this -> value [ 'x' ] , $ this -> value [ 'y' ] ) ; }
Set the New position for the current Tag

@return void
Set the New position for the current Tag