ToJSON

function ToJSON(bWriteNumberings: boolean = null, bWriteStyles: boolean = null): JSON

Description

Converts the ApiParagraph object into the JSON object.

Parameters

bWriteNumberingsbooleandefault: null

Specifies if the used numberings will be written to the JSON object or not.

bWriteStylesbooleandefault: null

Specifies if the used styles will be written to the JSON object or not.

Returns

JSON

Overloads

ToJSON(bWriteStyles)

Converts the ApiParaPr object into the JSON object.

Try It

var oDocument = Api.GetDocument();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a new paragraph");
var json = oParagraph.ToJSON(false, true);
var oParagraphFromJSON = Api.FromJSON(json);
oParagraphFromJSON.SetBold(true);
oDocument.AddElement(0, oParagraphFromJSON);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).