跳到主要内容

GetNext

Returns the next paragraph.

Syntax

expression.GetNext();

expression - A variable that represents a ApiRichParagraph class.

Parameters

This method doesn't have any parameters.

Returns

ApiRichParagraph

Example

This example gets next rich paragraph and adds some text to it.

let doc = Api.GetDocument();
let freeTextAnnot = Api.CreateFreeTextAnnot([160, 50, 360, 135]);
let page = doc.GetPage(0);
page.AddObject(freeTextAnnot);
freeTextAnnot.SetIntent("freeTextCallout");
freeTextAnnot.SetCallout([{x: 161, y: 51}, {x: 249, y: 125}, {x: 261, y: 125}]);
freeTextAnnot.SetRectDiff([100, 64, 0.5, 0.5]);

let richContent = freeTextAnnot.GetContent();
let para = Api.CreateRichParagraph();
para.AddText("Example text");
richContent.AddElement(0, para);
let nextPara = para.GetNext();
nextPara.AddText("This is next paragraph");

console.log(`We got next paragraph and added some text to it`);