Skip to main content

SetOutlineLvl

Sets the outline level for the specified properties.

Inherited from ApiParaPr.SetOutlineLvl.

Example

Set the outline level for the specified paragraph via paragraph properties in a PDF document.

// How can I set outline lvl using a paragraph properties in a PDF document?

// Set outline lvl for a paragraph properties in a PDF document.

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

const rgb = Api.CreateRGBColor(50, 100, 150);
const fill = Api.CreateSolidFill(rgb);
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape('rect', 200 * 36000, 50 * 36000, fill, stroke);
shape.SetPosition(10 * 36000, 10 * 36000);
page.AddObject(shape);

const outlineLvlIndex = 8;

const content = shape.GetContent();
const paragraph = content.GetElement(0);
const paraPr = paragraph.GetParaPr();
paraPr.SetOutlineLvl(outlineLvlIndex);
paragraph.AddText("This is a paragraph with outline level parameter set to " + (outlineLvlIndex + 1));