I am trying to read RTF data into DevExpress that includes a bulleted list like so:
- Item 1
- Item 2
- Item 3
I want to keep the items as paragraphs but want to remove all the “bullet-ing” — so that I would wind up with something like this that is not a list:
Item 1
Item 2
Item 3
I tried the following:
//Read rtf from blob in database
var rtf = ...
//RTF output lines
var list = new List<string>();
//Try to convert rtf
var documentServer = new RichEditDocumentServer();
documentServer.CreateNewDocument();
documentServer.Document.RtfText = rtf;
//Get RTF string for each line (without rtf code indicating line is part of a list)
foreach (var item in documentServer.Document.Paragraphs)
{
if (!String.IsNullOrWhiteSpace(documentServer.Document.GetText(item.Range)))
{
item.ListIndex = -1;
item.ListLevel = -1;
list.Add(documentServer.Document.GetRtfText(item.Range, options));
}
}
Unfortunately, this still seems to leave some RTF values related to the list for each line.
What do I need to convert those bulleted items into just plain paragraph text — or plain lines within a paragraph?