Skip to content

Function: coordToEmu() ​

coordToEmu(value, axisEmu): Emu

The single user-coordinate → EMU boundary. Convert each user-supplied coordinate exactly once.

Accepts (see Coord):

  • a bare number → always inches (the documented unit); no magnitude guessing
  • "<n>%" → percentage of axisEmu
  • "<n>in" / "<n>pt" / "<n>px" / "<n>emu" → explicit units (the escape hatch for non-inch values). px is resolved at DEFAULT_PX_PER_INCH (96), for authoring against a known web/source canvas size.

Throws on non-finite or unparseable input rather than silently emitting a degenerate 0-size.

Parameters ​

ParameterTypeDescription
valuestring | numberuser coordinate
axisEmunumberaxis length in EMU, used only to resolve percentages

Returns ​

Emu