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'.
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; }
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.
It would be nice to have the ability to search text in documents. Use case: I needed to replace some keywords with images. I can insert image at the current position, but there is no way to insert it after some text.
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 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; } }
Respect the Height property of TableRow when exporting with PdfFormatProvider.
When this type of section break is used, the next section should start on the same page instead on the next one.
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.
When the last run from a paragraph is underlined, the associated bullet has underline applied as well. The same applies for the background color.
Implement page border property which could be applied over the whole document or over a specific page.
In WordsProcessing you could set table.Alignment = Telerik.Windows.Documents.Flow.Model.Styles.Alignment.Center; But when the document is exported to PDF, this is not respected.
When table with table border without color set is created (the color is null), and the document is exported to PDF, ArgumentNullException is thrown. Workaround: Explicitly set a color where the color is null. private void PdfExport() { var tables = this.document.EnumerateChildrenOfType<Table>(); foreach (var table in tables) { TableBorders coloredClone = this.CopyTableBorders_SetColorWhenOmitted(table); table.Borders = coloredClone; using (Stream output = new FileStream(fileName, FileMode.OpenOrCreate)) { provider.Export(this.document, output); } } } private TableBorders CopyTableBorders_SetColorWhenOmitted(Table table) { var leftBorder = new Border(table.Borders.Left.Thickness, table.Borders.Left.Style, table.Borders.Left.Color ?? new ThemableColor(Colors.Transparent), table.Borders.Left.Shadow, table.Borders.Left.Frame, table.Borders.Left.Spacing); var rightBorder = new Border(table.Borders.Right.Thickness, table.Borders.Right.Style, table.Borders.Right.Color ?? new ThemableColor(Colors.Transparent), table.Borders.Right.Shadow, table.Borders.Right.Frame, table.Borders.Right.Spacing); var bottomBorder = new Border(table.Borders.Bottom.Thickness, table.Borders.Bottom.Style, table.Borders.Bottom.Color ?? new ThemableColor(Colors.Transparent), table.Borders.Bottom.Shadow, table.Borders.Bottom.Frame, table.Borders.Bottom.Spacing); var topBorder = new Border(table.Borders.Top.Thickness, table.Borders.Top.Style, table.Borders.Top.Color ?? new ThemableColor(Colors.Transparent), table.Borders.Top.Shadow, table.Borders.Top.Frame, table.Borders.Top.Spacing); var insideHorizontalBorder = new Border(table.Borders.InsideHorizontal.Thickness, table.Borders.InsideHorizontal.Style, table.Borders.InsideHorizontal.Color ?? new ThemableColor(Colors.Transparent), table.Borders.InsideHorizontal.Shadow, table.Borders.InsideHorizontal.Frame, table.Borders.InsideHorizontal.Spacing); var insideVerticalBorder = new Border(table.Borders.InsideVertical.Thickness, table.Borders.InsideVertical.Style, table.Borders.InsideVertical.Color ?? new ThemableColor(Colors.Transparent), table.Borders.InsideVertical.Shadow, table.Borders.InsideVertical.Frame, table.Borders.InsideVertical.Spacing); var tableBorders = new TableBorders(leftBorder, topBorder, rightBorder, bottomBorder, insideHorizontalBorder, insideVerticalBorder); return tableBorders; }
Implement import of PDF to RadFlowDocument, using PdfFormatProvider. This would require text recognition (including determining where paragraphs end as opposed to new line inserted because of the layout) and table recognition. This will allow conversion of PDF documents to docx, RTF and HTML.
Bookmark starts and ends that are not the child of a paragraph or table cannot be imported.
The <font> tag has a 'size' attribute that can be set to a number from 1 to 17. This is currently not supported and is just ignored.
When a document produced with WordsProcessing is validated with OpenXML Validator from OpenXML SDK, errors are found. While documents are valid according to the specification, Open XML SDK Validation shows errors related to the order of elements, etc. Resolve all errors, so DOCX documents pass validation.