Bookmark starts and ends that are not the child of a paragraph or table cannot be imported.
Styled text in a list item <li> is imported as a different paragraph. The result is split of the text into multiple paragraphs which are not in a list. The issue could be observed only when the text is written as a direct content of the <li> element. If it is in a <p> element the paragraph is imported correctly (it is not split). For example: problematic html (the paragraph will be split) - <li>An appointment may create any provisions <strong>and</strong> in particular: </li> non-problematic html (the paragraph will be imported as it should) - <li><p>An appointment may create any provisions <strong>and</strong> in particular: <p></li>
The document default style properties are not cloned on document.Clone(). There is a workaround by using the following code: var cloning = this.document.Clone(); ClearPropertiesWithoutValueAndSetLocalValues(this.document.DefaultStyle.CharacterProperties, cloning.DefaultStyle.CharacterProperties); ClearPropertiesWithoutValueAndSetLocalValues(this.document.DefaultStyle.ParagraphProperties, cloning.DefaultStyle.ParagraphProperties); private void ClearPropertiesWithoutValueAndSetLocalValues(DocumentElementPropertiesBase propertiesFrom, DocumentElementPropertiesBase propertiesTo) { foreach (var stylePropertyFrom in propertiesFrom.StyleProperties) { var stylePropertyTo = propertiesTo.GetStyleProperty(stylePropertyFrom.PropertyDefinition); stylePropertyTo.ClearValue(); if (stylePropertyFrom.HasLocalValue) { object value = stylePropertyTo.GetLocalValueAsObject(); stylePropertyTo.SetValueAsObject(value); } } }
Workaround: Copy the default styles after the Mail Merge RadFlowDocument merged = sourceDocument.MailMerge(mailMergeSource); merged.DefaultStyle.ParagraphProperties.CopyPropertiesFrom(sourceDocument.DefaultStyle.ParagraphProperties); merged.DefaultStyle.CharacterProperties.CopyPropertiesFrom(sourceDocument.DefaultStyle.CharacterProperties);
If the value from the source contains new lines, they should be inserted in the resulting documents as new paragraphs.
If we have a list (<ol>, <ul>) with list items (<li>) and there is a paragraph inside a list item(<p>), an empty additional paragraph is imported if the <p> element is right next to the <li> element (without a space). The indentation of child paragraphs in list item could be messed up as well. If there is a space between the HTML elements, the content is imported as expected.
When importing an image whose Uri is not a full Uri, an exception is thrown.
Workaround: private static void WorkaroundFieldsIssue(RadFlowDocument flowdocument) { foreach (FieldCharacter fieldCharacter in flowdocument.EnumerateChildrenOfType<FieldCharacter>().ToList()) { // only for start if (fieldCharacter.FieldCharacterType == FieldCharacterType.Start) { if (fieldCharacter.FieldInfo.Separator != null && fieldCharacter.FieldInfo.Separator.Parent == null) { Paragraph parent = fieldCharacter.FieldInfo.End.Paragraph; int index = parent.Inlines.IndexOf(fieldCharacter.FieldInfo.End); fieldCharacter.FieldInfo.End.Paragraph.Inlines.Insert(index, fieldCharacter.FieldInfo.Separator); } } } }
ParagraphMarkerProperties of a Paragraph element are not cloned and this leads to incorrect list numbering (bullets) rendering after export since the numbering styles (bullets, numbers and etc.) copy the style properties from there. This affects Clone() method of the Paragraph and ergo RadFlowDocumentEditor.InsertDocument() method and DocumentElementImporter.Import() methods since they're using Clone() method internally.