On this Page

    Script Units

    Several script extensions require the setting of document object positions or sizes. For example:

    Field1._left = "1.5in";

    Internally DocOrigin stores all positions and sizes in units of microns - 1/1000000 of an inch. When you request the value of an object's position or size you will get back an integer value in microns. However, when you set the value of a position or size you can also specify the number in various convenient units of measure:

    Field0._left = 1500000;     // 1500000 microns
    Field1._left = "1.5in";     // 1500000 microns
    Field2._left = '1.5"';      // 1500000 microns
    Field3._left = "10pt";      // 1389 microns
    Field4._left = "1.5cm";     // 590551 microns
    Field5._left = "15mm";      // 590551 microns

    Note that when doing arithmetic on these coordinates that you must use microns. The function _toDOUnits can also be used to convert from the above units to microns. The function _fromDOUnits can also be used to convert from the microns to the above units.

    Field2._left += _toDOUnits("1in");      // move 1 inch to the right
    Field3._left += 1000000;                // also move 1 inch
    _fromDOUnits(2000000, "in");            // returns 2 (inches)


    See Also

    _toDOUnits