Click or drag to resize
Pdftools logo

Size Structure

Struct that represents a size that is based on a width and height of type Length.

Constructs from standard paper sizes, generates a string representation, and sets portrait and landscape mode.

Inheritance Hierarchy
SystemObject
  SystemValueType
    PdfTools.Geometry.UnitsSize

Namespace: PdfTools.Geometry.Units
Assembly: PdfTools (in PdfTools.dll) Version: 1.5.0+84bd4d36da7e2449ee09fddee89e23a99b6ffcca
Syntax
C#
public struct Size

The Size type exposes the following members.

Properties
 NameDescription
Public propertyAspectRatio Calculate ratio between height and width.
Public propertyHeight

Get the height (vertical size) as Length object.

Public propertyWidth

Get the width (horizontal size) as Length object.

Public propertyStatic memberZero 
Top
Methods
 NameDescription
Public methodStatic membercm Create a Size object with the unit of height and width centimetre (symbol cm, equal to 0.01m).
Public methodEquals
(Overrides ValueTypeEquals(Object))
Public methodStatic memberFromLengths Create a Size object with the height and width as Length objects.
Public methodGetHashCode
(Overrides ValueTypeGetHashCode)
Public methodStatic memberin Create a Size object with the unit of height and width inch (symbol in, equal to 25.4mm or 72pt).
Public methodStatic memberkm Create a Size object with the unit of height and width kilometre (symbol km, equal to 1000m).
Public methodStatic memberm Create a Size object with the unit of height and width metre (symbol m, is the SI unit of length).
Public methodStatic membermm Create a Size object with the unit of height and width millimetre (symbol mm, equal to 0.001m).
Public methodStatic memberParse Create a Size object from length measurements or standard paper sizes.
Public methodStatic memberpt Create a Size object with the unit of height and width point (symbol pt, is the default unit used in PDF documents, equal to 1/72in or 25.4/72mm).
Public methodToLandscape Switches width and height if the absolute value of height is greater than the the absolute value of width.
Public methodToPortrait Switches width and height if the absolute value of the width is greater than the absolute value of the height.
Public methodToString Creates a string representation as width-height-pair with associated suitable metric units, "m", "cm" or "mm".
(Overrides ValueTypeToString)
Public methodStatic memberum Create a Size object with the unit of height and width micrometre (symbol um, equal to 0.000001m).
Top
See Also