Click or drag to resize
Pdftools logo

Length Structure

Struct that represents a measurable length.

Provides conversion between units, parsing of string representations, and basic mathematical operations.

The unit used in PDF documents is pt(Double) which is also used internally by the Length object to store length values. For that reason, when converting units from and to the internally used unit, minor numerical differences can occur due to floating-point arithmetic.

Inheritance Hierarchy
SystemObject
  SystemValueType
    PdfTools.Geometry.UnitsLength

Namespace: PdfTools.Geometry.Units
Assembly: PdfTools (in PdfTools.dll) Version: 1.0.0
Syntax
C#
public struct Length

The Length type exposes the following members.

Properties
 NameDescription
Public propertyStatic memberMaxValue 
Public propertyStatic memberZero 
Top
Methods
 NameDescription
Public methodStatic memberAbs 
Public methodcm Get the numerical length value in centimetres (symbol cm, equal to 0.01m).
Public methodStatic membercm(Double) Create a Length object with the unit centimetre (symbol cm, equal to 0.01m).
Public methodEquals
(Overrides ValueTypeEquals(Object))
Public methodGetHashCode
(Overrides ValueTypeGetHashCode)
Public methodin Get the numerical length value in inches (symbol in, equal to 25.4mm or 72pt).
Public methodStatic memberin(Double) Create a Length object with the unit inch (symbol in, equal to 25.4mm or 72pt).
Public methodkm Get the numerical length value in kilometres (symbol km, equal to 1000m).
Public methodStatic memberkm(Double) Create a Length object with the unit kilometre (symbol km, equal to 1000m).
Public methodm Get the numerical length value in metres (symbol m, is the SI unit of length).
Public methodStatic memberm(Double) Create a Length object with the unit metre (symbol m, is the SI unit of length).
Public methodStatic memberMax 
Public methodStatic memberMin 
Public methodmm Get the numerical length value in millimetres (symbol mm, equal to 0.001m).
Public methodStatic membermm(Double) Create a Length object with the unit millimetre (symbol mm, equal to 0.001m).
Public methodStatic memberParse Creates a Length object by parsing a string representation of a length with its unit.
Public methodStatic memberParseArray(String) Creates an array of Length by parsing a string representation of lengths with units.
Public methodStatic memberParseArray(String, Int32) Creates an array of Length by parsing a string representation of lengths with units.
Public methodStatic memberParseUnit Creates a Length object.
Public methodpt Get the numerical length value in points (symbol pt, is the default unit used in PDF documents, equal to 1/72in or 25.4/72mm).
Public methodStatic memberpt(Double) Create a Length object with the unit point (symbol pt, is the default unit used in PDF documents, equal to 1/72in or 25.4/72mm).
Public methodToString Creates a string representation with an associated suitable metric unit "m", "cm" or "mm".
(Overrides ValueTypeToString)
Public methodum Get the numerical length value in micrometres (symbol um, equal to 0.000001m).
Public methodStatic memberum(Double) Create a Length object with the unit micrometre (symbol um, equal to 0.000001m).
Top
Operators
See Also