Hi Brave and patient supporters!
Expected that inserted shapes expand tables. But somehow code:
[Test]
public void Shape()
{
var doc = new Document();
var builder = new DocumentBuilder(doc);
var table = builder.StartTable();
builder.InsertCell();
table.PreferredWidth = PreferredWidth.FromPercent(0);
builder.Writeln("Text 1");
builder.Write("Text 2");
builder.InsertCell();
var arrow = new Shape(doc.Document, ShapeType.Triangle)
{
Filled = true,
Width = 10,
Height = 10,
Rotation = 180,
StrokeColor = Color.Green,
FillColor = Color.Green
};
builder.InsertNode(arrow);
builder.InsertCell();
builder.Write("Text 3");
builder.InsertCell();
arrow = new Shape(doc.Document, ShapeType.Triangle)
{
Filled = true,
Width = 10,
Height = 10,
Rotation = 180,
StrokeColor = Color.Green,
FillColor = Color.Green
};
builder.InsertNode(arrow);
builder.EndRow();
builder.EndTable();
doc.Save(@"C:\\Shape.docx");
}
Comes with different result. It proves that shape size is ignored while creating table. How I create table cell taking shape size in custody? Otherwise table expands if cell text grows. Logically should react to shape in a same way as it is located in the cell. Please some advice here.