Unit

Backed enum for the document unit of measure. The backing value of each case is the canonical unit name used as a key of Format::UNITRATIO.

Namespace: Com\Tecnick\Pdf\Page

Backing type: string

File: Unit.php line 37

Backed enum for the document unit of measure. The backing value of each case is the canonical unit name used as a key of Format::UNITRATIO.

Tags

Cases

Point

File: Unit.php line 39

Millimeter

File: Unit.php line 41

Centimeter

File: Unit.php line 43

Inch

File: Unit.php line 45

Methods

fromLoose()

File: Unit.php line 58

public static fromLoose(string|self $value) : self

Accepts the canonical value, its aliases and the empty-string default, case-insensitively, or an enum instance (returned unchanged). Unknown values throw, matching Format::getUnitRatio().

Parameters

  • $value : string|self: Unit name or enum case.

Tags

  • throws: Exception if the value does not match a known unit.

Return values

self