Converting RTF into RVF using invisible RVE
Posted: Thu Sep 07, 2017 4:14 pm
Hi!
This question is related to the question I've asked before http://www.trichview.com/forums/viewtop ... f307f83c2a.
So I chose the second option with invisible form and converting RTF into RVF. The problem is initial styles in RTF differ from styles I get in RVF while converting and therefore from styles that I get in TRichView where I insert the text to.
Here is the source RTF I want to insert into TRichView https://drive.google.com/open?id=0ByzSd ... TRvZkRONmM.
And here is the way I insert that RTF into the hidden TRichViewEdit:
Now here are that files Value.rtf (https://drive.google.com/open?id=0ByzSd ... jZWY1RKV28) and Value.rve (https://drive.google.com/open?id=0ByzSd ... G54NFNYdFE). You can see that font differs. Font in Values.rtf is correct, in Values.rvf is not.
I've set TextStyleMode and ParaStyleMode to the invisible RVE but it doesn't help
Do I need to set any other settings?
This question is related to the question I've asked before http://www.trichview.com/forums/viewtop ... f307f83c2a.
So I chose the second option with invisible form and converting RTF into RVF. The problem is initial styles in RTF differ from styles I get in RVF while converting and therefore from styles that I get in TRichView where I insert the text to.
Here is the source RTF I want to insert into TRichView https://drive.google.com/open?id=0ByzSd ... TRvZkRONmM.
And here is the way I insert that RTF into the hidden TRichViewEdit:
Code: Select all
function RTFToRVE(RTF: TStream): TStream;
begin
FRve.Clear;
FRve.DeleteUnusedStyles(True, True, True);
if not FRve.LoadRTFFromStream(RTF) then
raise ERTFException.Create('Error RTF load!');
FRve.Format;
// And just now save the text in two formats
FRve.SaveRTF('C:\***\Value.rtf', False);
FRve.SaveRVF('C:\***\Value.rve', False);
end
I've set TextStyleMode and ParaStyleMode to the invisible RVE but it doesn't help
Code: Select all
FRve.RTFReadProperties.TextStyleMode := rvrsAddIfNeeded;
FRve.RTFReadProperties.ParaStyleMode := rvrsAddIfNeeded;