src/Html2Pdf.php
protected function _executeAction(Node $action)
    {
        $name = strtoupper($action->getName());

        if ($this->_firstPage && $name !== 'PAGE' && !$action->isClose()) {
            $this->_setNewPage();
        }

        // properties of the action
        $properties = $action->getParams();

        // name of the action (old method)
        $fnc = ($action->isClose() ? '_tag_close_' : '_tag_open_').$name;

        $tagObject = $this->getTagObject($action->getName());

        if (!is_null($tagObject)) {
            if ($action->isClose()) {
                $res = $tagObject->close($properties);
            } else {
                $res = $tagObject->open($properties);
            }
        } elseif (is_callable(array($this, $fnc))) {
            $res = $this->{$fnc}($properties);
        } else {
            $e = new HtmlParsingException(
                'The html tag ['.$action->getName().'] is not known by Html2Pdf. '.
                'You can create it and push it on the Html2Pdf GitHub project.'
            );
            $e->setInvalidTag($action->getName());
            $e->setHtmlLine($action->getLine());
            throw $e;
        }

        // save the name of the action
        $this->_previousCall = $fnc;

        // return the result
        return $res;
    }
protected function _executeAction(Node $action)
    {
        $name = strtoupper($action->getName());

        if ($this->_firstPage && $name !== 'PAGE' && !$action->isClose()) {
            $this->_setNewPage();
        }

        // properties of the action
        $properties = $action->getParams();

        // name of the action (old method)
        $fnc = ($action->isClose() ? '_tag_close_' : '_tag_open_').$name;

        $tagObject = $this->getTagObject($action->getName());

        if (!is_null($tagObject)) {
            if ($action->isClose()) {
                $res = $tagObject->close($properties);
            } else {
                $res = $tagObject->open($properties);
            }
        } elseif (is_callable(array($this, $fnc))) {
            $res = $this->{$fnc}($properties);
        } else {
            $e = new HtmlParsingException(
                'The html tag ['.$action->getName().'] is not known by Html2Pdf. '.
                'You can create it and push it on the Html2Pdf GitHub project.'
            );
            $e->setInvalidTag($action->getName());
            $e->setHtmlLine($action->getLine());
            throw $e;
        }

        // save the name of the action
        $this->_previousCall = $fnc;

        // return the result
        return $res;
    }
protected function _executeAction ( Node $ action ) { $ name = strtoupper ( $ action -> getName ( ) ) ; if ( $ this -> _firstPage && $ name !== 'PAGE' && ! $ action -> isClose ( ) ) { $ this -> _setNewPage ( ) ; } // properties of the action $ properties = $ action -> getParams ( ) ; // name of the action (old method) $ fnc = ( $ action -> isClose ( ) ? '_tag_close_' : '_tag_open_' ) . $ name ; $ tagObject = $ this -> getTagObject ( $ action -> getName ( ) ) ; if ( ! is_null ( $ tagObject ) ) { if ( $ action -> isClose ( ) ) { $ res = $ tagObject -> close ( $ properties ) ; } else { $ res = $ tagObject -> open ( $ properties ) ; } } elseif ( is_callable ( array ( $ this , $ fnc ) ) ) { $ res = $ this -> { $ fnc } ( $ properties ) ; } else { $ e = new HtmlParsingException ( 'The html tag [' . $ action -> getName ( ) . '] is not known by Html2Pdf. ' . 'You can create it and push it on the Html2Pdf GitHub project.' ) ; $ e -> setInvalidTag ( $ action -> getName ( ) ) ; $ e -> setHtmlLine ( $ action -> getLine ( ) ) ; throw $ e ; } // save the name of the action $ this -> _previousCall = $ fnc ; // return the result return $ res ; }
execute the action from the parsing

@param Node $action
execute the action from the parsing