Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

Text.TextToRTF

Creates RTF text for a given FileMaker formatted styled text.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Text 2.4 Yes Yes Yes Yes Yes

MBS( "Text.TextToRTF"; Text )

(old name: TextToRTF)

Parameters

Parameter Description Example value
Text Formatted text to convert. "Hello World"

Result

some text you could put into rtf file.

Description

Creates RTF text for a given FileMaker formatted styled text.
Currently only ANSI text encoding. Supports styles like bold, italic, underline, font size and text color. Other style features may be added in the future on demand.
Can be used with Clipboard.SetRTFText to bring styled text to the clipboard.

Examples

Convert some text to RTF

MBS( "Text.TextToRTF"; "Hello World" )

Example result:
{\rtf1\ansi\ansicpg1252
Hello World
}

Convert some text to HTML

MBS( "Text.TextToHTML"; "Hello World" )

Example result:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
</head>
<body>
<p>Hello World</p></body>
</html>

Write RTF file:

Set Variable [$rtf; Value:MBS( "Text.TextToRTF"; "Hello World äöü ß" )]
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; $rtf; "/Users/cs/Desktop/test.rtf"; "Windows")]

See also

Example Databases


Text.TextToHTML   -   Text.UpperCase

Feedback: Report problem or ask question.




Links
MBS FileMaker blog