FromJSON
Converts the specified JSON object into the Document Builder object of the corresponding type.
Parameters:
Name |
Type |
Description |
sMessage |
JSON
|
The JSON object to convert. |
Returns:
-
This method doesn't return any data.
Example
Copy code
builder.CreateFile("docx");
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);
builder.SaveFile("docx", "FromJSON.docx");
builder.CloseFile();
Resulting document