Insert Pagebreak in TRichView

General TRichView support forum. Please post your questions here
Post Reply
scchui
Posts: 3
Joined: Thu Aug 02, 2007 3:24 pm

Insert Pagebreak in TRichView

Post by scchui »

I am a newbie evaluating TRichView.

I mainly use TRichView to help me print pictures of the following code:

for i:=1 to 1000 do
begin
jpeg:=tjpegimage.create;
jpeg.LoadFromFile(inttostr(i) + '.jpg');
RichView1.AddPictureEx('', jpeg, -1, rvvaMiddle);
end;
By far I am very satisfied with TRichView to help me insert pictures and print. But I don't know how to insert page break to force a picture to start at a new page. I wonder how I can:
1) Insert pagebreak for a new page;
2) Whether I can determine the distance from a picture to the bottom margin or something like that.

Thanks for any help!

Rgds,
scchui
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This code adds page break befor the picture:

Code: Select all

...
RichView1.AddPictureEx('', jpeg, -1, rvvaMiddle); 
RichView1.PageBreaksBeforeItems[RichView1.ItemCount-1] := True;
...
Unfortunately, TRichView does not allow to determine this distance (it's only possible, using undocumented methods, when the document is already formatted for printing, i.e. after RVPrint.FormatPages)
scchui
Posts: 3
Joined: Thu Aug 02, 2007 3:24 pm

Post by scchui »

Thanks, it works!
Post Reply