Skip to content

More keys for the RTF parser

Summary

The TRTFParser in unit rtfpars is one of the many hidden gems in the FCL...

When trying to convert some files to html, however, I came across some RTF keys which the parser cannot handle although I saw them in several RTF files.

The provided patch adds the following keys to the list in rftdata.inc:

  • rtfNoSuperSub (\nosupersub)
  • rtfPngBlip (\pngblip)
  • rtfJpegBlip (\jpegblip)
  • rtfSub (\sub in addition to \dn)
  • rtfBackColor (\highlight in addition to \cb)
  • rtfUnicodeCount (\uc)
  • rtfAnsiCodePage (\ansicpg)

System Information

  • Operating system: I am using Windows 11, but the request should be independent of the OS.
  • Processor architecture: x86-64
  • Device: Computer

Patch

rtfparser.diff

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information