Page 1 of 1

RichEdit Print / PrintPreview - Append Virtual Lines

Posted: Thu Dec 30, 2010 11:52 pm
by andyhill
Hi, I have a need to Append Lines to the output on Print and PrintPreview but leave the original rve contents unchanged.

RVPrint1.AssignSource(rve);

add new lines here ?

RVPrint1.FormatPages(rvdoALL);

RVPrint1.Print('', 1, False);

Thanks
Andy

Posted: Fri Dec 31, 2010 1:24 am
by andyhill
Inserting other rv data and rtf data would be good to.

Posted: Sun Jan 02, 2011 1:11 pm
by Sergey Tkachenko
Copy rve to some hidden TRichView/TRichViewEdit control, append additional lines to it, then print this hidden control instead of rve.

Code: Select all

var Stream: TMemoryStream;

Stream := TMemoryStream.Create;
try
  rve.SaveRVFToStream(Stream, False);
  Stream.Position := 0;
  rvHidden.LoadRVFFromStream(Stream);
finally
  Stream.Free;
end;
rvHidden.AddNL(Last line', 0, 0);
RVPrint1.AssignSource(rvHidden);
...