|Top Previous Next|
TRVPrint = class(TCustomRVPrint)
How to Use
1.Assign the source component for printing (AssignSource method).
3.Format pages (FormatPages method).
4.Now you can:
▪get a number of pages (PagesCount property);
5.When finished, you can release some temporally allocated memory (Clear).
You can display some information about the process of repaginating and printing:
You can draw additional content using the following events:
▪OnPrintComponent requests image of inserted control for printing.
Margins are specified in Margins property.
Margins in TRVPrint
This picture illustrates the meaning of margin properties. Paragraph indents are not shown for simplification.
TRichView.LeftMargin, TRichView.RightMargin, TRichView.TopMargin and TRichView.BottomMargin are measured in "screen pixels" (they are recalculated according to the printer resolution, and margins on the page look like margins on the screen; shown in blue).
Left and right margins can be swapped for even pages, if MirrorMargins is set to True.
See also ClipMargins property.
Headers and Footers
TRVPrint supports 3 types of headers and footers:
▪normal header and footer
▪header and footer for the first page (used only if TitlePage=True)
▪header and footer for even pages (used only if FacingPages=True)
Header and Footer
If a header and/or a footer is too long, size of the main document is adjusted to avoid overlapping:
Long Header Example
If you want more flexible headers / footers, consider:
▪printing document in several parts, each of them with its own header/footer;
▪using OnPagePrepaint event;
Document inside RVPrint
RVPrint contains an instance of TPrintableRV (descendant of TRichView) inside. This variable (named rv) is public and you can change some properties of it:
Changing other its properties is not recommended.
MyRVPrint.rv.Color := clWhite;
Note: this richview does not contain the full information about the printed document, just a formatting information; so you must provide that source RichView is not destroyed while you are printing.
You can define the range of items to print, using MinPrintedItemNo and MaxPrintedItemNo properties. If these properties define a subrange of items, only this subrange (and only pages containing it) is printed.
These properties allow implementing an incremental printing: when the next portion of the document is ready, it can be printed below the previously printed fragment. This feature can be used for printing accounting journals, logs, etc.
Order of drawing
The component draws a page content in the following order:
5.Header's text boxes and sidenotes having PositionInText=rvpitAboveText
6.Footer's text boxes and sidenotes having PositionInText=rvpitBelowText
8.Footer's text boxes and sidenotes having PositionInText=rvpitAboveText
9.Main document's text boxes and sidenotes having PositionInText=rvpitBelowText
10.Main document, including footnotes and endnotes
11.Main document's text boxes and sidenotes having PositionInText=rvpitAboveText
Text boxes and sidenotes are drawn in the order of their positions in the parent document.
Tips and Tricks
▪RichViewAlternativePicPrint typed constant;
▪RichViewPixelsPerInch typed constant.
TRichView © trichview.com