Page 1 of 1

RVPrint FromPage

Posted: Wed Sep 14, 2011 6:16 am
by dalecurtis
I'm finding that the RVPrint.PrintPages method is not using the FromPage parameter - it always seems to use a value of 1. I've tried it in your Delphi/Assorted/Printing/Printing demos and the problem happens there as well. For example the following code is drawn from that demo:

procedure TForm1.btnPrintClick(Sender: TObject);
begin
if not PreviewCreated then begin
PreviewCreated := True;
UpdatePreview;
end;
// do not print empty document!
if RichView1.ItemCount=0 then
exit;
PrintDialog1.MinPage := 1;
PrintDialog1.MaxPage := RVPrint1.PagesCount;
PrintDialog1.FromPage := 1;
PrintDialog1.ToPage := RVPrint1.PagesCount;
// we can print a whole document or specified pages:
if PrintDialog1.Execute then begin
// it's possible that current printer was changed.
// so we need to reformat document and update preview:
UpdatePreview;
case PrintDialog1.PrintRange of
prAllPages:
RVPrint1.Print( 'Test', PrintDialog1.Copies, PrintDialog1.Collate);
prPageNums:
RVPrint1.PrintPages(PrintDialog1.FromPage, PrintDialog1.ToPage,
'Test', PrintDialog1.Copies, PrintDialog1.Collate);
end;
end;
end;

Thanks,
Dale

Posted: Wed Sep 14, 2011 7:09 am
by Sergey Tkachenko
This bug is already fixed in the latest version available for registered users.