Struct Unit
Namespace TallComponents.PDF.Layout
Unit is used to convert a wide variety of units to points, which is the unit used in PDF.
A point in PDF is exactly 1/72 inch. This is also known as a PostScript point. This class converts all units to PostScript points.
Constructors
Unit(Double)
Create a Unit from a value. The value is assumed to be in Points.
Unit(Double,UnitType)
Create a Unit from a value and a UnitType
Properties
Boolean IsRelative
This Unit is a relative value. True if this Unit is a percentage.
Double Points
Return the value of this Unit in points.
Methods
Boolean Equals(Object)
Determines whether two Object instances are equal.
Unit FromPixels(Int32,Double)
Create a unit from pixels and a resolution. Useful for
working with images.
Int32 GetHashCode()
Calculates a hash for this type.
Unit Parse(String)
Create a unit from a string.
Double ToPoint(String)
Convert a unit string to points
String ToString()
Returns the value of the Unit as a formatted string in points.
Operators
==
Compares two Unit objects for equality.
Implicit conversion from System.Double
Implicit conversion from double. This allows you to assign a double
to any variable or property of type Unit without constructors or casting.
Implicit conversion from System.String
Implicit conversion from string. This allows you to assign a sized string
to any variable or property of type Unit without constructors or casting.
Implicit conversion to System.Double
Implicit conversion to double. The value is expressed in points.
!=
Compares two Unit objects for inequality.