-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
21 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
builder.CreateFile("docx"); | ||
var oDocument = Api.GetDocument(); | ||
var oParagraph = Api.CreateParagraph(); | ||
var oRGBColor = Api.CreateRGBColor(255, 0, 0); | ||
var json = oRGBColor.ToJSON(); | ||
oParagraph.AddText("JSON representation of RGB color: " + json); | ||
oDocument.Push(oParagraph); | ||
GlobalVariable["RGBColorJSON"] = json; | ||
builder.CloseFile() | ||
///////////////////////// | ||
|
||
builder.CreateFile("docx"); | ||
var oDocument = Api.GetDocument(); | ||
var oParagraph = oDocument.GetElement(0); | ||
var json = GlobalVariable["RGBColorJSON"]; | ||
var oRGBColorFromJSON = Api.FromJSON(json); | ||
oRGBColorFromJSON.SetDefaultStyle(); | ||
oParagraph.AddElement(oRGBColorFromJSON); | ||
var oParagraph1 = Api.CreateParagraph(); | ||
let oDocument = Api.GetDocument(); | ||
let oParagraph = oDocument.GetElement(0); | ||
let oRGBColor = Api.CreateRGBColor(255, 111, 61); | ||
let json = oRGBColor.ToJSON(); | ||
oParagraph.AddText(json); | ||
let oRGBColorFromJSON = Api.FromJSON(json); | ||
let oGs1 = Api.CreateGradientStop(oRGBColor, 0); | ||
let oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 164, 101), 100000); | ||
let oFill = Api.CreateLinearGradientFill([oGs1, oGs2], 5400000); | ||
let oStroke = Api.CreateStroke(0, Api.CreateNoFill()); | ||
let oDrawing = Api.CreateShape("rect", 5930900, 395605, oFill, oStroke); | ||
let bWriteNumberings = false; | ||
let bWriteStyles = true; | ||
let sDrawingJson = oDrawing.ToJSON(bWriteNumberings, bWriteStyles); | ||
let oParagraph1 = Api.CreateParagraph(); | ||
oParagraph1.AddText(sDrawingJson); | ||
oDocument.Push(oParagraph1); | ||
oParagraph1.AddText(json); | ||
builder.SaveFile("docx", "RGBColorDocument.docx"); | ||
builder.CloseFile(); | ||
|
||
|
||
|
||
|
||
|
||
builder.SaveFile("docx", "RGBColorToJSON.docx"); | ||
builder.CloseFile(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters