Hello,
I wanted to insert a paragraph node at the current location.
I tried to use documentBuilder.insertNode but i get the following error “Cannot insert a node of this type at this location.”.
How can i proceed ?
Sincerely.
Hello,
I wanted to insert a paragraph node at the current location.
I tried to use documentBuilder.insertNode but i get the following error “Cannot insert a node of this type at this location.”.
How can i proceed ?
Sincerely.
@aaronArchest You can use builder.writeln()
to insert a paragraph break at the current location. If you need to insert an existing paragraph at the current location, you can use code like this:
// ...........
builder.writeln();
builder.getCurrentParagraph().getParentNode().insertBefore(paragraph, builder.getCurrentParagraph());
// ...........