Converts the ApiDrawing object into the JSON object.
Name | Type | Description |
bWriteNumberings | boolean | Specifies if the used numberings will be written to the JSON object or not. |
bWriteStyles | boolean | Specifies if the used styles will be written to the JSON object or not. |
builder.CreateFile("docx"); var oDocument = Api.GetDocument(); var oParagraph = oDocument.GetElement(0); var oGs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 224, 204), 0); var oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 164, 101), 100000); var oFill = Api.CreateLinearGradientFill([oGs1, oGs2], 5400000); var oStroke = Api.CreateStroke(0, Api.CreateNoFill()); var oDrawing = Api.CreateShape("rect", 5930900, 395605, oFill, oStroke); var json = oDrawing.ToJSON(false, true); var oDrawingFromJSON = Api.FromJSON(json); oParagraph.AddDrawing(oDrawingFromJSON); builder.SaveFile("docx", "ToJSON.docx"); builder.CloseFile();