PHP code example of roundcube / rtf-html-php

1. Go to this page and download the library: Download roundcube/rtf-html-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

roundcube / rtf-html-php example snippets


use RtfHtmlPhp\Document;

$rtf = file_get_contents("test.rtf"); 
$document = new Document($rtf); // or use a string directly

echo $document;

use RtfHtmlPhp\Html\HtmlFormatter;
$formatter = new HtmlFormatter();
echo $formatter->format($document);

$formatter = new HtmlFormatter('UTF-8');