Borders and table on each page of the document

General TRichView support forum. Please post your questions here
Post Reply
Vitalii
Posts: 61
Joined: Sat Oct 20, 2018 2:55 pm

Borders and table on each page of the document

Post 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.
Attachments
VCmaster_US_Catalog_004.png
VCmaster_US_Catalog_004.png (52.66 KiB) Viewed 25806 times
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Borders and table on each page of the document

Post by Sergey Tkachenko »

Tables inside tables?
Vitalii
Posts: 61
Joined: Sat Oct 20, 2018 2:55 pm

Re: Borders and table on each page of the document

Post 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?
Vitalii
Posts: 61
Joined: Sat Oct 20, 2018 2:55 pm

Re: Borders and table on each page of the document

Post 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...
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Borders and table on each page of the document

Post 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).
Vitalii
Posts: 61
Joined: Sat Oct 20, 2018 2:55 pm

Re: Borders and table on each page of the document

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Borders and table on each page of the document

Post 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.
Post Reply