1) Output of TRVPrint and TSRichViewEdit can be different even with identical margins, because they format text at different pixel density (DPI).
TRVPrint uses the printer DPI, to create output as good as possible.
TSRichViewEdit uses the predefined high DPI value (hard-coded, independent of printers), to provide the same output on all printers and the screen.
Also, the pagination procedures are different (TSRichViewEdit does not support page breaks in table cells).
2) About margins. They calculated differently in TRVPrint and TSRichViewEdit.
2.a) In TRVPrint, there are two kinds of margins:
- page margins defined in TRVPrint properties (outer margins)
- document margins (the same margins as you can see in TRichViewEdit, LeftMargin, TopMargin, etc. properties) (inner margins)
See the first picture here:
https://www.trichview.com/help/idh_class_trvprint.html
In RVF:
- inner margins are stored if rvfoSaveLayout and rvfoLoadLayout are included in RichViewEdit.RVFOptions
- outer margins are not stored; however, you can store identical properties of RichViewEdit.DocParameters (rvfoSaveDocProperties and rvfoLoadDocProperties in RVFOptions); after loading, you can apply them to TRVPrint using RichViewEdit.AssignToRVPrint method.
2.b) In TSRichViewEdit, the primary method of defining margins is TSRichViewEdit.PageProperty. However, an internal procedure synchronizes all other margins (in SRichViewEdit.RichViewEdit.DocParameters, SRichViewEdit.RichViewEdit.LeftMargin, SRichViewEdit.RichViewEdit.TopMargin, etc.), so they are set to the same values (but probably in different measure units).
And here comes the incompatibility: if you load RVF saved in TSRichViewEdit in TRichViewEdit, margins will be too large. It's because the values of RichViewEdit.LeftMargins, etc. (internal margins) are usually small, but in TSRichViewEdit they are equal to page margins. If TRVPrint applies is own margins, page margins are applied twice.
Unfortunately, it's hard to fix this incompatibility without adding new incompatibilities.
So:
- if possible, do not use TRichViewEdit to print documents created in TSRichViewEdit; use TSRichViewEdit, maybe with TSRVPrint and TSRVPrintPreview
- or you can set, after loading RVF, all TRichViewEdit's margins (LeftMargin, etc) = 0, and assign TRVPrint margins using AssignToRVPrint.