Steps to reproduce:
The pasted content is not formatted properly, resulting in an InvalidOperationException("'Token EndElement in state EndRootElement would result in an invalid XML document. Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML fragment. ') when saving the content to DOCX.
Steps to reproduce:
Workaround: intercept the table paste and add an empty paragraph as the first element of the document before the table.
Another case:
Try the following scenario:
No visual cue when image deleted or inserted when "Track changes" is activated.
When inserting an image with the Track Changes option toggled, the image should be underlined with red and it isn't. When deleting an image with Track Changes on, it is also not crossed with red. In both cases, the only mark that a change was made is the vertical line on the left.
Exception when importing a document with an empty table.
Workaround: Remove the empty tables:
DocxFormatProvider provider = new DocxFormatProvider();
var doc = provider.Import(File.ReadAllBytes(@"C:\Users\mpc\Downloads\22-51.docx"));
foreach (var section in doc.Sections)
{
var tables = section.EnumerateChildrenOfType<Table>();
foreach (var table in tables.ToList())
{
if (table.Rows.Count == 0)
{
section.Blocks.Remove(table);
}
}
}
radRichTextBox.Document = doc;