TPlusToRTF component
PlusMemo Help Send comments on this topic.
TPlusToRTF component

Glossary Item Box

 


Unit

PlusToFormat

 

Declaration (partial)

type

    TPlusToFormattedText = class(TComponent);

    TPlusToRTF = class(TPlusToFormattedText);

 

Description

TPlusToRTF is a non-visual component to export the content of a TPlusMemo in rtf format, with static and dynamic formatting reproduction.  The output can be sent to a file, to the clipboard, or simply collected as a string.  The output can encompass the complete content, or just the selected text.  Component TPlusToHtml works similarly but results in html code being produced instead of rtf.

 

A page break character (#12) at the start of a paragraph will produce a page break in generated rtf code.  It is possible for the user to enter such a page break character by typing Ctrl-P.

 

To use TPlusToRtf, place one instance on your form, set its PlusMemo property to the TPlusMemo you want to obtain the text from, and call one of the code generation methods from your application.

 

Key properties

Run-time only

  DynFormat A Boolean property to control if dynamic formatting is reproduced in the output code generated.
  PlusMemo The TPlusMemo instance we want to produce rtf code from.
  RTFLeading The line spacing to use in generated output code.
  Selection Returns a string representing the rtf code corresponding to currently selected text.
  Text Returns a string representing the rtf code corresponding to the content of PlusMemo.

 

Key methods

  CopyToClipboard Call this to put the rtf code corresponding to selected text on the clipboard.
  SaveToFile Saves the rtf code corresponding to all the content of PlusMemo in a file.
  SaveToStream Same as above, but writes to a stream instead of a file.

 

Key events

  OnProgress Occurs periodically while doing SaveToFile or SaveToStream.