Back to Devexpress

Measure Units in Rich Text Documents

windowsforms-7091-controls-and-libraries-rich-text-editor-rich-edit-control-document-measure-units.md

latest2.3 KB
Original Source

Measure Units in Rich Text Documents

  • Dec 24, 2021

You can select a single unit of measurement to specify various distance values of a document (page width and height, margins, etc.). Set the Document.Unit or RichEditControl.Unit property to one of the following values:

Unit of MeasurementDescription
DocumentDefault property value. A document unit corresponds to 1/300 of an inch. Internal calculations are currently performed using this unit of measurement.
CentimeterCentimeter (1 inch is equal to 2.54 centimeters)
InchInch
MillimeterMillimeter (10 millimeters are equal to 1 centimeter)
PointPoint (1 inch is equal to 72 points)

Measure Units in the RichEditControl Document

The Document.Unit property value determines the units of measurements in the following cases:

Document elements on the document layout level are measured in DocumentLayoutUnit.Twip (1 inch is equal to 1440 twips). This measurement is used when you determine the coordinates of the layout elements (the LayoutElementBase.Bounds property), the cursor bounds (the RichEditView.GetCursorBounds() property), etc.

Tip

Use the DevExpress.Office.Utils.Units class methods to convert units of measurements.

See Also

Units