PHP Classes

RTF Generator: Create RTF documents from HTML

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (15)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 45%Total: 19,157 All time: 39 This week: 96Down
Version License Categories
rtfgenerator 1.0.0GNU General Publi...HTML, Files and Folders, Text processing


This is a class for creating RTF document files from HTML.

RTF is a popular rich text format meant for interchange of documents between any word processor program.

The class parses and converts to RTF various HTML tags, such as:

<strong>, <em>, <u>, <strike>, <ul>, <li>, <br>, <p>, <h1>, <h2>, <h3>

An example script is included to implement a Web based WYSIWYG editor that saves documents in RTF format.

Innovation Award
PHP Programming Innovation award nominee
August 2004
Number 3

Prize: One book of choice by SAMS
RTF is a rich text document format used by many word processing programs for interchange of documents. RTF documents can be read by most word processing programs.

This class provides a solution for generating RTF documents from formatted text definition based on a subset of HTML tags making it possible to generate documents that can be read, edited or printed in many different platforms.

Manuel Lemos
Picture of Thomas Graham
Name: Thomas Graham <contact>
Classes: 2 packages by
Country: United Kingdom
Age: 37
All time rank: 675 in United Kingdom
Week rank: 332 Down16 in United Kingdom Down
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Plain text file class_rtf.php Class The class source file
Accessible without login Plain text file getrtf.php Example Example of class use
Accessible without login HTML file index.html Example Form example
Accessible without login Plain text file rtf_config.php Conf. Default config file
Accessible without login Plain text file source_rtf.php Conf. Source file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:39
This week:96Down
User Ratings User Comments (6)
 All time
usless code, does not work at all
12 years ago (harpreet bhatia)
12 years ago (jigs)
It's very basic.
13 years ago (Luke)
A good class that has saved me a lot of hassle with RTF gener...
14 years ago (Igor Zinovev)
If it works would be really really useful.
15 years ago (Thales Jacobi)
Very few tags are supported, doesn't work for <table> and oth...
15 years ago (sona)