Skip to main content

GetTextPr

Returns the text properties for a paragraph end mark.

Syntax

expression.GetTextPr();

expression - A variable that represents a ApiParagraph class.

Parameters

This method doesn't have any parameters.

Returns

ApiTextPr

Example

Read the text formatting properties of a paragraph in a document.

// How do I retrieve the text properties object from a paragraph in a document?

// Fetch existing paragraph text properties and extend them with italic formatting in a document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a sample text with the font size set to 30 and the font weight set to bold.");
let textPr = Api.CreateTextPr();
textPr.SetFontSize(32);
textPr.SetBold(true);
paragraph.SetTextPr(textPr);
textPr = paragraph.GetTextPr();
textPr.SetItalic(true);
paragraph.SetTextPr(textPr);