Skip to main content

GetSection

Returns the paragraph section.

Syntax

expression.GetSection();

expression - A variable that represents a ApiParagraph class.

Parameters

This method doesn't have any parameters.

Returns

ApiSection

Example

Retrieve the section that contains a given paragraph in a document.

// How do I find the section a paragraph belongs to in a document?

// Resize the page by accessing the section through one of its paragraphs in a document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a new paragraph.");
let section = paragraph.GetSection();
section.SetPageSize(7200, 4320);