This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

PHP Library for RTF processing

v1.0.0 2021-02-08 11:46 UTC

This package is auto-updated.

Last update: 2021-09-08 13:02:19 UTC


PHP Library for RTF processing, port of nrtftree (https://github.com/sgolivernet/nrtftree).

This is work in progress with some additional feature:

  • Introduce new white space node type to preserve the original rich text document loaded.
  • ReplaceTextEx can replace text which is scattered across nodes.
  • Rtf document with measurement unit support (native, mm, cm, inch, pixel).


  • PHP 5.3+


There are 3 main classes for RTF processing.


The RTF tree parser, able to parse RTF document into tree nodes, perform selects the nodes based on keyword, perform search and replace of the plain text, and convert back the nodes as RTF code.


RTF tree with additional document entity handler, such as colors, fonts, stylesheets, and objects.


RTF tree builder.


  • Rtf Merger
  • Examples