Page 1 of 1

Printing of labels

Posted: Tue Sep 06, 2005 12:14 pm
by markkuin2
I use the richview component to print labels with customer data. I do this by creating a layout which is small enough to fit on one label. I modified the component to be able to print more then one document on a single page (by adjusting the left, right, top and bottom margin in the TPrintableRVData.Prepare procedure, depending on the position of the label). My question is: is it possible to incorporate such functionality in the package? Maybe more people are interested in it. My problem now is that when a new Richview version releases, I need to insert my changes with the risk of inserting bugs...

Posted: Tue Sep 06, 2005 1:29 pm
by Sergey Tkachenko
Actually, the possibility of printing several documents on one page already exists (but not documented):

Code: Select all

Printer.BeginDoc;
RVPrint.StartAt := 0;
RVPrint.TransparentBackground := True;
RVPrint.AssignSource(RichView1);
RVPrint.FormatPages(rvdoALL);
RVPrint.ContinuousPrint;
RVPrint.StartAt := RVPrint.EndAt;
if RVPrint.rv.Height-RVPrint.StartAt<some safe value then
begin
  Printer.NewPage;
  RVPrint.StartAt := 0;
end;
RVPrint.AssignSource(RichView2);
RVPrint.FormatPages(rvdoALL);
RVPrint.ContinuousPrint;
Printer.EndDoc;