Hi,
When adding a TextBox with DocumentBuilder.InsertShape(ShapeType.TextBox)
, it seems to be the last node in the document, so builder.MoveToDocumentEnd()
moves to the textbox, not after it. So everything ends up in the textbox…
static void Main(string[] args)
{
var doc = new Document();
var builder = new DocumentBuilder(doc);
builder.Writeln("Before Text Box");
builder.InsertShape(ShapeType.TextBox, 100, 100);
builder.Write("In Text Box");
builder.MoveToDocumentEnd();
builder.Writeln("After Text Box");
builder.MoveToDocumentEnd();
builder.Writeln("After Text Box 2");
doc.Save(@"aspose-document-builder-text-box.docx");
}
See attached reproduction:
TextboxMoveToDocumentEnd.zip (17.2 KB)
and expected result
expected.zip (21.2 KB)
What is the proper way to add a textbox “in text”?
Thanks.