跳到主要内容

Select

选择当前图形对象。

继承自 ApiDrawing.Select。

语法​

expression.Select(isReplace);

expression - 表示 ApiTable 类的变量。

参数​

名称必需/可选数据类型默认值描述
isReplace可选booleanfalse指定选择是否应替换当前选择(true)还是添加到当前选择(false)。

返回值​

boolean

示例​

在 PDF 中选择表格,使其成为当前选区。

// Programmatically select a table in a PDF.

// Add a table to the page, select it, then change its background color.

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

const table = Api.CreateTable(3, 3);
table.SetPosition(0, 0);
page.AddObject(table);
table.Select();
table.SetBackgroundColor(Api.RGB(0, 122, 204));