[Example] How to combine several documents in one
Posted: Tue Oct 25, 2005 9:20 pm
Code: Select all
procedure AddDoc(const FileName: String; rv: TCustomRichView);
var Stream: TFileStream;
begin
Stream := TFileStream.Create(FileName, fmOpenRead);
rv.InsertRVFFromStream(Stream, rv.ItemCount);
Stream.Free;
end;
...
RichView1.Clear;
RichView1.DeleteUnusedStyles(True, True, True);
AddDoc('c:\file1.rvf', RichView1);
AddDoc('c:\file2.rvf', RichView1);
AddDoc('c:\file3.rvf', RichView1);
RichView1.Format;
Code: Select all
procedure AddDoc(const FileName: String; rv: TCustomRichView);
var Stream: TFileStream;
ItemCount: Integer;
begin
ItemCount := rv.ItemCount;
Stream := TFileStream.Create(FileName, fmOpenRead);
rv.InsertRVFFromStream(Stream, rv.ItemCount);
Stream.Free;
if (ItemCount>0) and (ItemCount<rv.ItemCount) then
rv.PageBreaksBeforeItems[ItemCount] := True;
end;