Hello,
I am trying to figure out if this is even possible. I want to write a simple document editor that incorporates multiple pages. Using the AdvRichEditor I can see it is possible to set page format but can't figure out if it is possible to add page breaks at the max length of the format. On solution that I've tried was to create a new AdvRichEditor once it reaches the max lines but its pretty infeffective. Is there a way to set a page break once the length of the content of one AdvRichEditor set to a format to emulate a new page ?
Is this only a feature for printing ?
Thank you.
For printing, TAdvRichEditor should respect (printed) page size and cause a page break when going to the next page. For display, TAdvRichEditor behaves similar to WordPad (or Outlook email client), i.e. shows a continuous flow of text.
Hi,
I'm not on RTF printing, but if you investigate further, I'm sure you'll get very better results.
There's no range checking - this is just brute force , but a very interesting starting point:
procedure TForm1.AdvRichEditor1DrawBackground(Sender: TObject; ACanvas: TCanvas;
ARect: TRect);
begin
acanvas.Brush.Color := clsilver;
acanvas.Brush.Style := bsSolid;
acanvas.Rectangle(100,1122 + ARECT.Top,AdvRichEditor1.Width - 100,1124 + ARECT.TOP);
acanvas.Rectangle(100,2244 + ARECT.Top,AdvRichEditor1.Width - 100,2246 + ARECT.TOP);
acanvas.Rectangle(100,3366 + ARECT.Top,AdvRichEditor1.Width - 100,3368 + ARECT.TOP);
end;
Those 3 "rectangles" will draw 3 background "page separator" thin lines very similar to A4 height ever since you have a dpi ratio of 1 (100%).
1 Like