Sidenotes in TRichView Documents
Sidenote contains a subdocument. This subdocument is not displayed in TCustomRichView where the sidenote is inserted, but it can be printed inside a floating box.
ScaleRichView note: TSRichViewEdit displays and allows editing sidenotes.
Class for this item type is TRVSidenoteItemInfo (see for detailed information).
Style of this item type: rvsSidenote (-206)
The following items are inherited from numbered sidenotes:
The following viewer-style method adds item of this type to the end of the document:
The following method returns TRVSidenoteItemInfo object
The following editor-style method inserts item of this type in the position of caret:
The following method returns TRVSidenoteItemInfo object at the position of caret:
The following methods change properties of items as editing operations:
Sidenotes have all properties of numbered sequences.
▪SeqName = '@sidenote@' and must not be changed.
Additionally, it has the following properties:
▪BoxPosition – properties relative to the position of a text box;
▪BoxProperties – size, border, background, content alignment of a text box.
These properties are also accessible as rveipcFloatHorizontalAnchor, rveipcFloatHorizontalPositionKind, rveipcFloatHorizontalOffset, rveipcFloatHorizontalAlign, rveipcFloatVerticalAnchor, rveipcFloatVerticalPositionKind, rveipcFloatVerticalOffset, rveipcFloatVerticalAlign, rveipcFloatRelativeToCell, rveipcFloatPositionInText, rveipcBoxWidth, rveipcBoxHeight, rveipcBoxWidthType, rveipcBoxHeightType, rveipcBoxBorderColor, rveipcBoxBorderWidth, rveipcBoxBorderInternalWidth, rveipcBoxBorderStyle, rveipcBoxBorderVisibleBorders_Left, rveipcBoxBorderVisibleBorders_Top, rveipcBoxBorderVisibleBorders_Right, rveipcBoxBorderVisibleBorders_Bottom, rveipcBoxBorderBorderOffsets_Left, rveipcBoxBorderBorderOffsets_Top, rveipcBoxBorderBorderOffsets_Right, rveipcBoxBorderBorderOffsets_Bottom, rveipcBoxColor, rveipcBoxPadding_Left, rveipcBoxPadding_Top, rveipcBoxPadding_Right, rveipcBoxPadding_Bottom, rveipcBoxVAlign properties. Accessing them in this way allows changing them in editing operations.
Export to HTML
Subdocuments for all sidenotes are saved after the main document. Before each subdocument, <a name="sidenoteN"></a> is inserted, where N is an index of this sidenote (in the list of all numbered sequences and notes). Sidenotes are saved as hyperlinks to this anchor.
Sidenotes can be exported in RTF. They are imported as NoteText followed by a text box containing Document. A bookmark named '_sidenoteN' (where N is an index of this sidenote) is added around NoteText, to allow saving note references as references to this bookmark.
Some combinations of box positioning properties are not supported by Microsoft Word*, so TRichView converts them:
▪MS Word does not support a vertical alignment relative to a paragraph, so it saved as an alignment relative to a line;
▪MS Word does not support a relative (percent) positioning to a line or paragraph, so it is saved as an absolute positioning (with zero offset);
▪when a line is chosen as an anchor object, MS Word aligns a text box not relative to a whole line but relative to a line top, so a center and a bottom alignment relative to a line are different in TRichView and in MS Word;
(* this information is based on tests of MS Word 2013)
Floating boxes cannot be imported from RTF (yet).
Sidenotes can be exported in DocX, both in the old (VML) and the new (DrawingML) formats.
See the comments about RTF.
When copying or saving a selected text, sidenotes are not included in text. When saving the whole text, they are saved inside , for example:
This is a text [a sequence of characters] to show sidenotes [b note of text placed in a floating box].