Appending from a RVF into ScaleRichView

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Posts: 9
Joined: Fri Nov 24, 2017 6:16 am

Appending from a RVF into ScaleRichView

Post by pgkammath » Sun Nov 25, 2018 12:42 pm

I could not find an answer in the forum, hence the question. Pardon me if this is silly, since I am short on time for the project.

I want to append an RVF file at the end of my current ScalerichView file, (I modified the the Actiontest from the demo from scalerichview) .
I use the following code for that.

In the file 1664.rvf, the data is Right Aligned, but when it is appended, it becomes left aligned. I am bit confused on accessing the parastyles etc in scalerichview.

First I load into a RichViewEdit, then to the Actual Editor, is there any other way where i can directly append this file.

var Stream: TMemoryStream;
cFile : String;
cFile := '\\bmh-doc\RADIOLOGY\SIGNATURES\1664.rvf'; // This part is dynamic . I added for a reference


Stream := TMemoryStream.Create;
RichViewEdit1.SaveRVFToStream(Stream, False);

Stream.Position := 0;

// This is the scalerichview Editor

Please help,
thanks in advance.

Sergey Tkachenko
Site Admin
Posts: 14377
Joined: Sat Aug 27, 2005 10:28 am

Re: Appending from a RVF into ScaleRichView

Post by Sergey Tkachenko » Sun Nov 25, 2018 6:44 pm

Use InsertRVFFromStream instead of AppendRVFFromStream:

Code: Select all

TextEdit.RichViewEdit.InsertRVFFromStream(Stream, TextEdit.RichViewEdit.ItemCount);
AppendRVFFromStream is useful if you want to override a paragraph style of the first paragraph of the inserted content.
When you call TextEdit.RichViewEdit.AppendRVFFromStream(Stream, 0), the first inserted paragraph is formatted using TextEdit.RichViewEdit.Style.ParaStyles[0]

Post Reply