Text.RTFToText
--------------

Parses RTF to styled text.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Text](component_Text.md) | [11.3](newinversion113.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Text.RTFToText"; RTFData ) 

**MBS**( **"Text.RTFToText";** /\* Parses RTF to styled text. \*/  
**$RTFData**) /\* The RTF data text. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| RTFData | The RTF data text. |  |

### Result

Returns styled text or error.

### Description

Parses RTF to styled text.  
Should find texts, font name/size, some styles like italic/bold/underline and color.  
  
We read the input with Windows ANSI encoding to get characters right for RTF files from Windows without encoding specs, so if you read it from a file with [Text.ReadTextFile](TextReadTextFile.md), please specify "Windows" as encoding to use.  
  
If the container contains a RTF file, you may need to read text content with [Text.ReadTextFromContainer](TextReadTextFromContainer.md) first.  
### Examples

Convert RTF in a field to styled text in a new field

 Set Field \[ test::StypedText ; MBS ( "Text.RTFToText"; test::RTFText ) \]  
Read text from a text clipping:

 Let(\[  
 containerValue = Kontakte::Foto ;  
 plist = MBS ( "[PList.ReadData](PListReadData.md)"; containerValue );  
 rtf = JSONGetElement ( plist; "\['UTI-Data'\].\['public.rtf'\]");  
 text = MBS ( "Text.RTFToText"; rtf)  
\]; text)  
### See also

- [PList.ReadData](PListReadData.md)
- [Text.ReadTextFile](TextReadTextFile.md)
- [Text.ReadTextFromContainer](TextReadTextFromContainer.md)

### Release notes

- **Version 11.3**
    - Added [Text.RTFToText](https://www.mbsplugins.eu/TextRTFToText.shtml) function.

### Example Databases

- [Mac only/RichText/RTF to formatted text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/RichText/RTF%20to%20formatted%20text.shtml#1ScriptAnchor_)
- [Text functions/Text to RTF or HTML](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Text%20to%20RTF%20or%20HTML.shtml#1ScriptAnchor_)

### Blog Entries

- [New in MBS FileMaker Plugin 11.3](https://www.mbsplugins.de/archive/2021-07-27/New_in_MBS_FileMaker_Plugin_11/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 11.3](https://www.mbsplugins.de/archive/2021-07-12/Neues_MBS_FileMaker_Plugin_113/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.3 - More than 6500 Functions In One Plugin](https://www.mbsplugins.de/archive/2021-07-12/MBS_FileMaker_Plugin_113_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.3pr1](https://www.mbsplugins.de/archive/2021-06-03/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 19th May 2021 , last changed 16th May 2024

  
[Text.MimeTypeToFileExtension](TextMimeTypeToFileExtension.md) - [Text.ReadEMLXFile](TextReadEMLXFile.md)

[HTML Version](TextRTFToText.shtml)