Add Heading via JavaScript in Plugin

Do you want to: Ask a how-to question
I wrote a plugin, which adds text to the current document. I want to start the text with a Title, a Heading 1 and then add normal text.

How do I add the style to the text for Heading and Title?

let oDocument = Api.GetDocument();
let para = Api.CreateParagraph();
para.AddText(‘HEADING 1’);

Cheers

Hello @

You can use SetStyle method for that goal.