[]
GcWord allows you to add predefined geometrical shapes which are visual figures with filling and outline. A few examples of shapes include rectangle, arrow, ellipse, hexagon etc. A shape can be added in a document by using Add and Insert methods of ShapeCollection class. You can also access the previous or next shapes, apply fill format, line format, group fill, shape style etc. by using methods provided by Shape class.
GcWord supports 188 geometrical shapes which can be viewed by downloading the Word document.
To add shape in a document:
Create a new Word document by instantiating GcWordDocument class.
Add a run to a newly added paragraph by using Add method of RunCollection class.
Add an arc shape by using Add method of ShapeCollection class and pass GeometryType.Arc as its parameter.
Set its fill formatting property and theme color by using FillType and ThemeColorId enumeration.
var doc = new GcWordDocument();
//Create a Run element
var run = doc.Body.Paragraphs.Add().GetRange().Runs.Add();
//Add an arc shape
var shape = run.GetRange().Shapes.Add(200, 300, GeometryType.Arc);
shape.Line.Fill.Type = FillType.Solid;
shape.Line.Fill.SolidFill.ThemeColor = ThemeColorId.Accent4;
doc.Save("shape.docx");
Note: You can also export Word document containing shapes to PDF and image formats. To know more, refer Export topic.
Limitations
Effects and derived classes (EffectsDAG, EffectsList) are not supported.