I’m trying to replace bookmark with table it works perfectly but when replacing same bookmark with table
it append the table to the old table not replacing here is my code:
DocumentBuilder builder = new DocumentBuilder(asposeDocument);
builder.MoveToBookmark(input.Key, true, true);
Table table = builder.StartTable();
// Make the header row.
builder.InsertCell();
table.AllowAutoFit = true;
table.LeftPadding = 5.0;
table.RightPadding = 5.0;
table.BottomPadding = 5.0;
table.TopPadding = 5.0;
// Set height and define the height rule for the header row.
builder.RowFormat.Height = 30.0;
builder.RowFormat.HeightRule = HeightRule.AtLeast;
// Some special features for the header row.
builder.CellFormat.Shading.BackgroundPatternColor = Color.FromArgb(198, 217, 241);
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Font.Size = 12;
builder.Font.Bold = false;
builder.Font.Name = "Calibri";
builder.EndRow();
// Set features for the other rows and cells.
builder.CellFormat.Shading.BackgroundPatternColor = Color.White;
builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
// Reset height and define a different height rule for table body
builder.RowFormat.Height = 30.0;
builder.RowFormat.HeightRule = HeightRule.Auto;
// Reset font formatting.
builder.Font.Size = 12;
builder.Font.Bold = false;
// Build the other cells.
builder.Write("This is row 1 cell 1");
// Insert a cell
builder.InsertCell();
builder.Write("This is row 1 cell 2");
builder.EndRow();
// Insert a cell
builder.InsertCell();
builder.Writeln("This is row 2 cell 1");
// Insert a cell
builder.InsertCell();
builder.Writeln("This is row 2 cell 2");
builder.EndRow();
builder.EndTable();