Page 1 of 1

Borders and table on each page of the document

Posted: Sat Dec 21, 2019 1:15 pm
by Vitalii
Hi there!
I want to ask advice. Our clients often want to see a document with a frame that is made according to a certain rule (standard). The frame can have mini-tables located at the edges of the document (left, right, top, and bottom). Usually, this frame is repeated on all pages or except the first one. Dimensions of the frame and mini-tables (for example, margins and distances between border and edge of document) are strictly fixed.

What is the best way to implement this with TRichView?
An example of such a frame in the screenshot.

Re: Borders and table on each page of the document

Posted: Sat Dec 21, 2019 3:28 pm
by Sergey Tkachenko
Tables inside tables?

Re: Borders and table on each page of the document

Posted: Sat Dec 21, 2019 3:36 pm
by Vitalii
At first I thought that the table is not the best solution... Or is it possible to "rigidly" fix the indentation of the table from the edges of the sheet, for example, 5 mm each? And is it possible to repeat this table on each sheet without copying?

Re: Borders and table on each page of the document

Posted: Sat Dec 21, 2019 5:16 pm
by Vitalii
I also thought about the background with the option "bsTiled". But in this case, the image of the frame (table) needs to be prepared somewhere... Maybe let the user create a table, then make it a bitmap and use this image as a background?

The case with the image instead of the table seems to me more "elegant", as it does not limit the user in space. In this case, it is enough to adjust the indents from text to frame...

Re: Borders and table on each page of the document

Posted: Sat Dec 21, 2019 8:55 pm
by Sergey Tkachenko
In TRichViewEdit, editing is not WYSIWYG. There are no pages in TRichViewEdit, so you cannot draw this image on every page.
in TRVPrint, you can use OnPagePrepaint event to draw this frame on each page, but it will be invisible in TRichViewEdit.

If you need WYSIWYG editing, you can use ScaleRichView (and draw this frame in OnPaintPage event; this drawing will be visible both on the screen and on papers).

Re: Borders and table on each page of the document

Posted: Sun Dec 22, 2019 8:07 am
by Vitalii
Sergey, maybe Header/Footer is the best solution in this case? And draw two vertical lines (left and right, to connect header and footer tables)? But for them to be visible in the document, I need ScaleRichView (not TRichView), right?

Re: Borders and table on each page of the document

Posted: Sun Dec 22, 2019 10:22 am
by Sergey Tkachenko
Headers and footers are useful only if they have the same content on all pages (only content of a page number may change).

Actually, I think that inserting predefined tables would be the best solution.