Skip to content

Commit

Permalink
fix: 66725
Browse files Browse the repository at this point in the history
  • Loading branch information
askonev committed Mar 26, 2024
1 parent 16db879 commit 6f18391
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions js/docx/smoke/api_range/to_json.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
var oRange = Api.CreateRange(oParagraph, 0, 9);
var json = oRange.ToJSON(true, true);
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
var oRange = Api.CreateRange(oParagraph, 0, 10);
var json = oRange.ToJSON(true, true);
GlobalVariable["JSON"] = json;
builder.CloseFile();

////////////////////////

builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var json = GlobalVariable["JSON"]
var oRangeFromJSON = Api.FromJSON(json);
oDocument.Push(oRangeFromJSON[0]);
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText(json);
var oDocument = Api.GetDocument();
var json = GlobalVariable["JSON"]
var oRangeFromJSON = Api.FromJSON(json);
oDocument.Push(oRangeFromJSON[0]);
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText(json);
builder.SaveFile("docx", "ParagraphToJSON.docx");
builder.CloseFile();

0 comments on commit 6f18391

Please sign in to comment.