GetRow
Returns a row by its index.
Syntax
expression.GetRow(rowIndex);
expression - A variable that represents a ApiTable class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| rowIndex | Required | number | The zero-based row index in the table. |
Returns
Example
Access a specific row from a table in a PDF.
// How do I select a table row by its position in a PDF?
// Extract the row you need from a table in a PDF.
const doc = Api.GetDocument();
const page = doc.GetPage(0);
const table = Api.CreateTable(2, 4);
table.AddRow(1, true);
const row = table.GetRow(0);
const cell = row.GetCell(0);
const content = cell.GetContent();
const paragraph = Api.CreateParagraph();
paragraph.AddText("This is a sample text in the first row.");
content.Push(paragraph);
page.AddObject(table);