public void DocumentGetText_ToString()
{
//ExStart
//ExFor:CompositeNode.GetText
//ExFor:Node.ToString(SaveFormat)
//ExId:NodeTxtExportDifferences
//ExSummary:Shows the difference between calling the GetText and ToString methods on a node.
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
Console.WriteLine("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.
Console.WriteLine("ToString() Result: " + doc.ToString(SaveFormat.Text));
//ExEnd
}