Rave - Imprimindo RichText sobre multiplas paginas |
Top Previous Next |
Tip #20 - Printing RichText across multiple pages
Category Code Based - General
Question
How do I print RichText across multiple pages?
Solution
It is often necessary to print memos containing RTF across multiple pages. This can easily be done with the following code:
Delphi Example:
uses RPMemo;
procedure TForm1.ReportSystem1Print(Sender: TObject); var MemoBuf: TMemoBuf; begin With Sender as TBaseReport do begin MemoBuf := TMemoBuf.Create; MemoBuf.BaseReport := Sender as TBaseReport; try MemoBuf.RichEdit := RichEdit1; MemoBuf.PrintStart := 1.0; MemoBuf.PrintEnd := 7.0; While not MemoBuf.Empty do begin MemoBuf.PrintHeight(SectionBottom - LineTop,false); If not MemoBuf.Empty then begin NewPage; end; { if } end; { while } finally MemoBuf.Free; end; { tryf } end; { with } end;
|