At this point only styling through CSS is supported. The below code does not align the paragraph to the center string import = "<html><body><p align=\"center\">centered??</p></body></html>"; RadFlowDocument document = provider.Import(import);
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); } } } }
Implement evaluation of = (Formula) fields (https://support.office.com/en-us/article/Field-codes-Formula-field-32d5c9de-3516-4ec3-80ed-d1fc2b5bc21d?ui=en-US&rs=en-US&ad=US ). This will allow export to PDF and HTML.
Style properties defined in an element style selector are evaluated with higher priority over properties in a CSS class when importing from HTML. For example if we have the following CSS style: .sectionheading { border: 10px solid red; } td { border: 10px solid black; } and the class (.sectionheading) is applied on a table cell: <td class="sectionheading">...</td> The result in WordsProcessing after import of such HTML will be that the table cell has 10px black border. In MS Word and in the browsers (Chrome, Firefox...) the result will be that the cell has 10px red border.
If the Table's TableCellSpacing property is not divided by 2 when the document is exported to Docx or Rtf, this leads to incorrect rendering after the exported document is opened with another editor (RadRichTextBox, MS Word). Workaround: Divide by two the Table's table cell spacing property value before export to Docx, RTF formats: foreach (Table table in document.EnumerateChildrenOfType<Table>()) { table.TableCellSpacing /= 2; }
Table's 'cellspacing' and 'cellpadding' are not imported from HTML when the unit is not specified, e.g. <table cellpadding="25">. According to the HTML Specification (https://www.w3.org/TR/REC-html40/struct/tables.html#adef-cellspacing), the only permitted values are: - only number - number followed by percent. MS Word imports it according to the specification (like WordsProcessing), but all of the browsers successfully imports values even with the px suffix, e.g. '25px'.
The alternative text allows setting a description of the information contained inside the table and is useful for people who may not be able to see the content.
An ArgumentException is thrown when importing HTML containing standard and non-standard pseudo classes or pseudo elements. The concreete scenario is the following: .myclass::-webkit-scrollbar or .myclass::-ms-expand The message of the exception is similar to this: "Unexpected character found at position [X]: ".. scrollbar::>>-<<webkit-scrollbar"".
When the <sectPr> element is not defined as the last child element but appears in different position of the <body> of the document, the content after <sectPr> is not imported. Although some applications handle this case, according to the Office Open XML specification, the sectPr element must be the last element inside the <body>.
When a document has a deleted text as part of track changes and there is a comment on the deletion, the document throws InvalidOperationException upon import.
If the background color is applied to <tr> element then it is not imported. Workaround: The background color may be applied to the cells (<td> elements) in the desired row and this should have the same effect.
There are multiple tags and attributes in the Open XML model which define the formatting of the complex script characters and are not implemented in the WordsProcessing model. Such tags are: szCs: Complex script font size; bCs: Complex script bold; iCs: Complex script italic; Attributes: cstheme: Complex Script Theme Font; The cs (Complex Script Font) attribute is implemented in the export, but it is not preserved in the model on import.
Currently, the align attribute is supported only for a table and when applied to a cell or row is omitted on import.
In a DOCX document, the users can define an image which is bigger than the size of the page. When such an image is at the beginning of the document and is converted with PdfFormatProvider, an additional page is added in the result PDF.
foreach (var image in document.EnumerateChildrenOfType<ImageInline>()) { var section = image.Paragraph.Parent as Section; if (image.Image.Height > section.PageSize.Height - section.PageMargins.Top - section.PageMargins.Bottom) { var height = section.PageSize.Height - section.PageMargins.Top - section.PageMargins.Bottom - (image.Paragraph.Spacing.SpacingAfter * (image.Paragraph.Spacing.LineSpacing - 0.97)); image.Image.Size = new System.Windows.Size(image.Image.Width, height); } }
When applying a table or table cell border with no thickness specified, the border is exported with a default thickness value of zero. However, by specification, the default value should be 2.
Workaround: Create a border by specifying the thickness value. For example:
table.Borders = new TableBorders(new Border(thickness, BorderStyle.Single, new ThemableColor(Colors.Black)));