跳到主要内容

MillimetersToPoints

将毫米转换为磅。

语法

expression.MillimetersToPoints(mm);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
mm必需number要转换为磅的毫米数。

返回值

number

示例

将毫米测量值转换为排版磅并在文档中显示结果。

// How do I translate a length from millimeters into points in a document?

// Display the point equivalent of a millimeter value as a paragraph of text in a document.

const doc = Api.GetDocument();
const paragraph = Api.CreateParagraph();

const millimeters = 100;
const points = Api.MillimetersToPoints(millimeters);
paragraph.AddText(millimeters + ' millimeters are equal to ' + points + ' points.');
doc.Push(paragraph);