The 'border' attribute of Html <table /> is imported wrong. When set to 0, a 1px border is rendered.
The exception is thrown during the exporting of the document with the following stack trace:
Telerik.Windows.Documents.Flow.FormatProviders.Docx.Model.Elements.Styles.ShadingElement.FillAttributes(IPropertiesWithShading properties)When replacing a string within a run that is not the first element in the paragraph an unexpected behavior occurs.
These are the known cases:
Introduce an option to replace a Run text with line breaks and/or new lines or with other document elements such as Table, Image, Paragraph and etc. The following code snippet shows how a Run can be replaced with another inline element: RadFlowDocument document = new RadFlowDocument(); RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document); editor.InsertText("text"); editor.InsertText("REMOVE"); editor.InsertText("text"); foreach (Run run in document.EnumerateChildrenOfType<Run>().ToList()) { if (run.Text == "REMOVE") { Paragraph paragraph = run.Paragraph; int childIndex = paragraph.Inlines.IndexOf(run); ImageInline image = new ImageInline(document); using (Stream stream = File.OpenRead("example_image.png")) { image.Image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(stream, "png"); } paragraph.Inlines.Insert(childIndex, image); paragraph.Inlines.Remove(run); } }
According to the OOXML specification the shading color can be defined only in RRGGBB hex color, but MS Word also supports colors defined with their names - e.g. "Red".
ArgumentException with 'Invalid value' message is thrown when importing invalid font sizes from docx, e.g. <w:sz></w:sz> (the 'val' attribute should be specified according to the OOXML specification). Instead, such documents could be imported as the w:sz is not specified, similar to the behavior of MS Word.
When the indentation of a paragraph is coming from a list, the RTF format provider applies them to the paragraph as local properties. This affects all conversions of documents containing lists from RTF to HTML. Workaround: After importing the document check if the indentation of the paragraph is the same as the one coming from the list. Here is example on how this could be done: RtfFormatProvider provider = new RtfFormatProvider(); RadFlowDocument document = provider.Import(stream); foreach (Paragraph paragraph in document.EnumerateChildrenOfType<Paragraph>()) { List list = this.document.Lists.GetList(paragraph.ListId); if (paragraph.Indentation.HangingIndent == list.Levels[0].ParagraphProperties.HangingIndent.LocalValue) { paragraph.Indentation.HangingIndent = Paragraph.HangingIndentPropertyDefinition.DefaultValue.Value; } if (paragraph.Indentation.FirstLineIndent == list.Levels[0].ParagraphProperties.FirstLineIndent.LocalValue) { paragraph.Indentation.FirstLineIndent = Paragraph.FirstLineIndentPropertyDefinition.DefaultValue.Value; } }
Enable the customers to work with .dot files.
Enable the customers to work with .doc files.