function rtf()
    {
        $ret = "{\\rtf\n";
        foreach ($this->data as $entry) {
            $line = $this->rtfstring;
            $title = '';
            $journal = '';
            $year = '';
            $authors = '';
            if (array_key_exists('title', $entry)) {
                $title = $this->_unwrap($entry['title']);
            }
            if (array_key_exists('journal', $entry)) {
                $journal = $this->_unwrap($entry['journal']);
            }
            if (array_key_exists('year', $entry)) {
                $year = $this->_unwrap($entry['year']);
            }
            if (array_key_exists('author', $entry)) {
                if ($this->_options['extractAuthors']) {
                    $tmparray = array(); //In this array the authors are saved and the joind with an and
                    foreach ($entry['author'] as $authorentry) {
                        $tmparray[] = $this->_formatAuthor($authorentry);
                    }
                    $authors = join(', ', $tmparray);
                } else {
                    $authors = $entry['author'];
                }
            }
            if (('' != $title) || ('' != $journal) || ('' != $year) || ('' != $authors)) {
                $line = str_replace("TITLE", $title, $line);
                $line = str_replace("JOURNAL", $journal, $line);
                $line = str_replace("YEAR", $year, $line);
                $line = str_replace("AUTHORS", $authors, $line);
                $line .= "\n\\par\n";
                $ret .= $line;
            } else {
                $this->_generateWarning('WARNING_LINE_WAS_NOT_CONVERTED', '', print_r($entry, 1));
            }
        }
        $ret .= '}';
        return $ret;
    }
function rtf()
    {
        $ret = "{\\rtf\n";
        foreach ($this->data as $entry) {
            $line = $this->rtfstring;
            $title = '';
            $journal = '';
            $year = '';
            $authors = '';
            if (array_key_exists('title', $entry)) {
                $title = $this->_unwrap($entry['title']);
            }
            if (array_key_exists('journal', $entry)) {
                $journal = $this->_unwrap($entry['journal']);
            }
            if (array_key_exists('year', $entry)) {
                $year = $this->_unwrap($entry['year']);
            }
            if (array_key_exists('author', $entry)) {
                if ($this->_options['extractAuthors']) {
                    $tmparray = array(); //In this array the authors are saved and the joind with an and
                    foreach ($entry['author'] as $authorentry) {
                        $tmparray[] = $this->_formatAuthor($authorentry);
                    }
                    $authors = join(', ', $tmparray);
                } else {
                    $authors = $entry['author'];
                }
            }
            if (('' != $title) || ('' != $journal) || ('' != $year) || ('' != $authors)) {
                $line = str_replace("TITLE", $title, $line);
                $line = str_replace("JOURNAL", $journal, $line);
                $line = str_replace("YEAR", $year, $line);
                $line = str_replace("AUTHORS", $authors, $line);
                $line .= "\n\\par\n";
                $ret .= $line;
            } else {
                $this->_generateWarning('WARNING_LINE_WAS_NOT_CONVERTED', '', print_r($entry, 1));
            }
        }
        $ret .= '}';
        return $ret;
    }
function rtf ( ) { $ ret = "{\\rtf\n" ; foreach ( $ this -> data as $ entry ) { $ line = $ this -> rtfstring ; $ title = '' ; $ journal = '' ; $ year = '' ; $ authors = '' ; if ( array_key_exists ( 'title' , $ entry ) ) { $ title = $ this -> _unwrap ( $ entry [ 'title' ] ) ; } if ( array_key_exists ( 'journal' , $ entry ) ) { $ journal = $ this -> _unwrap ( $ entry [ 'journal' ] ) ; } if ( array_key_exists ( 'year' , $ entry ) ) { $ year = $ this -> _unwrap ( $ entry [ 'year' ] ) ; } if ( array_key_exists ( 'author' , $ entry ) ) { if ( $ this -> _options [ 'extractAuthors' ] ) { $ tmparray = array ( ) ; //In this array the authors are saved and the joind with an and foreach ( $ entry [ 'author' ] as $ authorentry ) { $ tmparray [ ] = $ this -> _formatAuthor ( $ authorentry ) ; } $ authors = join ( ', ' , $ tmparray ) ; } else { $ authors = $ entry [ 'author' ] ; } } if ( ( '' != $ title ) || ( '' != $ journal ) || ( '' != $ year ) || ( '' != $ authors ) ) { $ line = str_replace ( "TITLE" , $ title , $ line ) ; $ line = str_replace ( "JOURNAL" , $ journal , $ line ) ; $ line = str_replace ( "YEAR" , $ year , $ line ) ; $ line = str_replace ( "AUTHORS" , $ authors , $ line ) ; $ line .= "\n\\par\n" ; $ ret .= $ line ; } else { $ this -> _generateWarning ( 'WARNING_LINE_WAS_NOT_CONVERTED' , '' , print_r ( $ entry , 1 ) ) ; } } $ ret .= '}' ; return $ ret ; }
Returns the stored data in RTF format

This method simply returns a RTF formatted string. This is done very
simple and is not intended for heavy using and fine formatting. This
should be done by BibTex! It is intended to give some kind of quick
preview or to send someone a reference list as word/rtf format (even
some people in the scientific field still use word). If you want to
change the default format you have to override the class variable
"rtfstring". This variable is used and the placeholders simply replaced.
Lines with no data cause an warning!

@return string the RTF Strings
Returns the stored data in RTF format