跳到主要内容

PicasToPoints

将派卡转换为磅。

语法

expression.PicasToPoints(pc);

expression - 表示 Api 类的变量。

参数

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

返回值

number

示例

此示例展示如何将派卡转换为磅。

const picas = 100;
const points = Api.PicasToPoints(picas);

const rgb = Api.RGB(50, 150, 250);
const fill = Api.CreateSolidFill(rgb);
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape('rect', 150 * 36000, 150 * 36000, fill, stroke);
const paragraph = shape.GetContent().GetElement(0);
paragraph.AddText(picas + ' picas are equal to ' + points + ' points.');

const doc = Api.GetDocument();
const page = doc.GetPage(0);
page.AddObject(shape);