[]
        
(Showing Draft Content)

C1.C1Preview.C1PrintDocument.ConvertUnit

ConvertUnit Method

ConvertUnit(Unit, UnitTypeEnum)

Converts an absolute Unit value to the specified measurement units (this overload cannot convert to pixels).

Declaration
public double ConvertUnit(Unit source, UnitTypeEnum destUnitType)
Parameters
Type Name Description
Unit source

The source Unit value to convert (must be an absolute value).

UnitTypeEnum destUnitType

The destination unit type (UnitTypeEnum; cannot be Pixel).

Returns
Type Description
double

A double representing the source value expressed in destUnitType units.

Remarks

The source must be an absolute value, such as "5mm", "1.5in", "8" and so on. The source cannot be an expression (such as "prev.width" or "prev.height*2+2mm").

The destination units cannot be Pixel. To convert to pixels, use ConvertUnit(Unit, UnitTypeEnum, float) instead.

ConvertUnit(Unit, UnitTypeEnum, float)

Converts an absolute Unit value to the specified measurement units.

Declaration
public double ConvertUnit(Unit source, UnitTypeEnum destUnitType, float destDpi)
Parameters
Type Name Description
Unit source

The source Unit value to convert (must be an absolute value).

UnitTypeEnum destUnitType

The destination unit type (UnitTypeEnum).

float destDpi

The destination resolution (DPI; used if the destUnitType is Pixel).

Returns
Type Description
double

A double representing the source value expressed in destUnitType units.

Remarks

The source must be an absolute value, such as "5mm", "1.5in", "8" and so on. The source cannot be an expression (such as "prev.width" or "prev.height*2+2mm").