Skip to main content
Skip table of contents

Unit conversion operators

This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP

These operators were added in Harlequin 12.1r1.

The in2pt , ft2pt , mm2pt , cm2pt and m2pt operators convert a size from inches, feet, mm, cm or meters to default user units (commonly describes as points). These can be useful for setting values such as PageSize in configuration and control files.

The pt2in , pt2ft , pt2mm , pt2cm , and pt2m operators convert a size from points to inches, feet, mm, cm or meters. These can be useful for reporting values in debug or informational output.

All of these operators can accept either a single number or an array of numbers.

When called with a single number they will replace the number on the stack with the converted size as a single number.

For example:

25.4 mm2pt

will leave 72.0 on the operand stack.

When called with an array of numbers they will replace the array with a new array containing the converted sizes

For example:

<< /PageSize [ 210 297 ] mm2pt >> setpagedevice

will set the page size to [595.276 841.89 ]

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.