I have a document with fields, that must be replaced with values. Several documents will be created by using different values. All these documents should come in a large document, with each document beginning on a new page. This resulting document must be shown in a print preview and be printed. What is the best way to create such composite document?
There's a demo on that topic on http://www.trichview.com/forums/viewtopic.php?t=87 but its targeted at TRichViewEdit and TRVPrint. I'm using TSRichViewEdit and TSRVPrint.
How to compose a document from multiple documents?
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Use TSRVPrint to print several documents on one printing job.
TSRVPrint.PrintFramesEx prints one page.
TSRVPrint.PrintFramesEx prints one page.
Code: Select all
var FirstPage: Boolean;
FirstPage := True;
Printer.BeginDoc;
for i := 0 to DocumentCount-1 do begin
<prepare the i-th document here>
for j := 1 to SRichViewEdit.PageCount do begin
if FirstPage then
FirstPage := False
else
Printer.NewPage;
SRVPrint1.PrintFramesEx(j);
end;
Printer.EndDoc;
Yes. For this purpose you need to display pages. For page drawing, it is necessary to use function:
Description of parametres of function look in the help.
Code: Select all
procedure DrawPage(PageNo, PageWd, PageHt, OffX, OffY: Integer;
CanvasPage: TCanvas; PageNoVisible, ClipMargins, Printing: Boolean);