TRichView is designed to use the current application page settings. But if you want to store page information in RVF files, you can do it using the code below.

This code is not necessary if you use ScaleRichView. It does all this work automatically.

Page information is written and read in DocParameters property, containing subproperties for storing page size, orientation and margins.
This property is saved and loaded in RVF if rvfoSaveDocProperties and rvfoLoadDocProperties are included in RVFOptions property.
This property is saved and loaded in RTF if rvrtfSaveDocParameters is included in RTFOptions, and RTFReadProperties.ReadDocParameters = True.

If you use RichViewActions, you may wish to store additional properties, for example properties of header and footer. See viewtopic.php?t=10 how to access them.
You can use rve.DocProperties to store them:

Assign printing settings to DocParameters and DocProperties when these settings are changed. If you use RichViewActions, use rvActionPageSetup.OnChange event.

If you use TDBRichViewEdit, use OnLoadDocument event to apply loaded values, and OnNewDocument to reset them to the defaults.
If you use RichViewActions, use rvActionOpen.OpenFile to apply loaded values (TrvActionNew resets the to default automatically).

The code described in this topic is still valid.
However, some corrections are needed.

1. Use Header and Footer properties of TRVAControlPanel instead of RVA_HeaderInfo and RVF_FooterInfo
2. You can still use "MM" properties of TRVPrint (like HeaderYMM, LeftMarginMM), but they are deprecated. The recommended properties are HeaderY, FooterY, Margins.

Also, there is one more way to store custom information in RVF. Instead of DocProperties string list, you can use DocObjects collection.

-using RVPrint.Margings, RVPrint.HeaderY, RVPrint.FooterY instead of deprecated RVPrint.***MM properties
- assigning TitlePage and FacingPages property
- the code for assigning DocParameters uses DocParameters.Units and does not change it
- using RV_UnitsToUnits function from RVFuncs units
- using TRVAControlPanel.Header instead of a deprecated function

TRichView is designed to use the current application page settings. But if you want to store page information in RVF files, you can do it using the code below.

This code is not necessary if you use ScaleRichView. It does all this work automatically.

Page information is written and read in DocParameters property, containing subproperties for storing page size, orientation and margins.
This property is saved and loaded in RVF if rvfoSaveDocProperties and rvfoLoadDocProperties are included in RVFOptions property.
This property is saved and loaded in RTF if rvrtfSaveDocParameters is included in RTFOptions, and RTFReadProperties.ReadDocParameters = True.

If you use RichViewActions, you may wish to store additional properties, for example properties of header and footer. See viewtopic.php?t=10 how to access them.
You can use rve.DocProperties to store them:

Assign printing settings to DocParameters and DocProperties when these settings are changed. If you use RichViewActions, use rvActionPageSetup.OnChange event.

If you use TDBRichViewEdit, use OnLoadDocument event to apply loaded values, and OnNewDocument to reset them to the defaults.
If you use RichViewActions, use rvActionOpen.OpenFile to apply loaded values (TrvActionNew resets the to default automatically).