PHPackages                             silvermine/php-rtflex - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. silvermine/php-rtflex

AbandonedArchivedLibrary

silvermine/php-rtflex
=====================

91.2k9[3 issues](https://github.com/silvermine/php-rtflex/issues)PHP

Since Dec 17Pushed 7y ago3 watchersCompare

[ Source](https://github.com/silvermine/php-rtflex)[ Packagist](https://packagist.org/packages/silvermine/php-rtflex)[ RSS](/packages/silvermine-php-rtflex/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WARNING: UNMAINTAINED PROJECT
=============================

[](#warning-unmaintained-project)

This project is no longer supported or maintained. Please consider using a different project for new development.

RTFLex
======

[](#rtflex)

[![Build Status](https://camo.githubusercontent.com/0881e14e7f0f43426eb1ce1144ef0cbcc25f36652fae169f30a191fa221345c6/68747470733a2f2f7472617669732d63692e6f72672f73696c7665726d696e652f7068702d7274666c65782e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/silvermine/php-rtflex)

RTFLex is a simple lexer / tokenizer for RTF formatted data.

Example Usage
-------------

[](#example-usage)

RTFLex allows you to easily extract plain text from an RTF formatted file. Here how you would do that:

```
require_once "rtflex/RTFLexer.php";

use RTFLex\io\StreamReader;
use RTFLex\tokenizer\RTFTokenizer;
use RTFLex\tree\RTFDocument;

$reader = new StreamReader('/path/to/myFile.rtf');
$tokenizer = new RTFTokenizer($reader);
$doc = new RTFDocument($tokenizer);
echo $doc->extractText();

```

While RTFLex uses namespaces to organize it's inner-workings, it also provides a simple, global, front-end class for easy of use. This accomplishes the same as the above code:

```
require_once "rtflex/RTFLexer.php";

$doc = RTFLexer::file('/path/to/myFile.rtf');
echo $doc->extractText();

```

RTFLex also lets you easily extract hidden metadata from an RTF file. Take, for example, the follow RTF header:

```
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf370
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\info
{\title Sample Title}
{\subject Sample Subject}
{\author Craig Weber}
{\*\company silvermine}
{\*\copyright 2013 silvermine.}}\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
...

```

Using the RTFDocument class, it's easy to extract those field.

```
$doc = RTFLexer::file('/path/to/myFile.rtf');
echo $doc->extractMetadata('title');     // => "Sample Title"
echo $doc->extractMetadata('copyright'); // => "2013 silvermine."

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/afb14d8743a9b3332178a2287b83c33e7ad0ab5f0d988b1fd622cb4a176ed23c?d=identicon)[crgwbr](/maintainers/crgwbr)

---

Top Contributors

[![crgwbr](https://avatars.githubusercontent.com/u/173216?v=4)](https://github.com/crgwbr "crgwbr (16 commits)")[![jthomerson](https://avatars.githubusercontent.com/u/171934?v=4)](https://github.com/jthomerson "jthomerson (1 commits)")[![onebytegone](https://avatars.githubusercontent.com/u/8900251?v=4)](https://github.com/onebytegone "onebytegone (1 commits)")

### Embed Badge

![Health badge](/badges/silvermine-php-rtflex/health.svg)

```
[![Health](https://phpackages.com/badges/silvermine-php-rtflex/health.svg)](https://phpackages.com/packages/silvermine-php-rtflex)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
