Hi,
Found the answer:
Hi Mariusz,
Thank you. What’s the difference between getText() and toString(SaveFormat.TEXT)?
Hi Mariusz,
Document doc = new Document();// Enter a dummy field into the document.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertField(“MERGEFIELD Field”);// GetText will retrieve all field codes and special characters
System.out.println("GetText() Result: " + doc.getText());// ToString will export the node to the specified format. When converted to text it will not retrieve fields code
// or special characters, but will still contain some natural formatting characters such as paragraph markers etc.
// This is the same as “viewing” the document as if it was opened in a text editor.
System.out.println("ToString() Result: " + doc.toString(SaveFormat.TEXT));
Great, thank you for the clarification!