Page 1 of 1

LoadRTF without font but with bold, underline, italic format

Posted: Thu Sep 04, 2014 1:11 pm
by BernhardRoos
Hello,

I want at runtime Import RTF Streams, but without the font and size. It should use the font and size of the item Position. But other formatting of the rtf should be used, for example bold, underline, italic.

Is there a way to do this :

I have the following code :

RVData.DeleteItems(i, 1);
Stream := TStringStream.Create(sText);
Stream.Position := 0;
RVData.LoadRTFFromStream(Stream);
Stream.Free;

RVData is TCustomRVFormattedData

With my code it works, but is using the font and size of the RTF.

Best wishes
Bernhard

Posted: Thu Sep 04, 2014 2:04 pm
by Sergey Tkachenko
Unfortunately, it is not possible: you can either ignore all text/paragraph attributes from RTF, or apply all of them.

A solution is loading RTF in a hidden TRichView, changing its font and size to the required font and size, save the modified document to RVF or RTF stream, and insert this stream to the main editor.