HtmlFormatProvider does not maintain all the whitespaces on import even though {style="white-space: pre;"} was set.
It should support {style="white-space: pre-wrap;"} as well.
It can eventually be extended to support all the property's values: normal|nowrap|pre|pre-line|pre-wrap|initial|inherit.
HtmlFormatProvider: Unstyled nested <ul> elements inherit the parent <ol> numbering style during HTML import.
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>.
Exception when there are merge fields in the header/footer and one performs mail merge:
Unable to cast object of type 'Telerik.Windows.Documents.Flow.Model.Header' to type 'Telerik.Windows.Documents.Flow.Model.BlockBase
If Paragraph has applied style, and this style has associated list, and the paragraph is removed from the list locally, then on import the paragraph is added to the list.
The additional numbering could be removed from the paragraph by changing its style:
foreach (var p in this.document.EnumerateChildrenOfType<Paragraph>())
{
if (p.ListLevel == 0)
{
var style = new Telerik.Windows.Documents.Flow.Model.Styles.Style("NoListStyle", StyleType.Paragraph);
style.ParagraphProperties.CopyPropertiesFrom(this.document.StyleRepository.GetStyle(p.StyleId).ParagraphProperties);
style.ParagraphProperties.ListId.LocalValue = null;
style.ParagraphProperties.ListLevel.LocalValue = null;
p.StyleId = "NoListStyle";
}
}
The tblGrid property should be exported in order to visualize properly the documents in some viewers. For example, LibreOffice doesn't visualize properly tables without specified width.
Import the following HTML content:
<ol type="a">
<li>
<div><p>WordsProcessing</p>
</div></li>
<li>
<div>
<p>SpreadProcessing</p>
</div>
</li>
<li>
<div>
<p>PdfProcessing</p>
</div>
</li>
</ol>The following error occurs:
When list level items are empty - <li></li> - they are not imported as empty paragraphs in list. The expected is that a Paragraph, associated to a list to be imported.
Unexpected table content indentation during PDF export when cells lack explicit margins and do not inherit table-level margins.
Manual Workaround Before PDF Export:
Preserve direct cell overrides; materialize table-default padding only for cells with no local padding:
foreach (var section in document.Sections)
{
foreach (var block in section.Blocks)
{
if (!(block is Table table))
{
continue;
}
foreach (var row in table.Rows)
{
foreach (var cell in row.Cells)
{
if (!cell.Properties.Padding.HasLocalValue)
{
cell.Padding = table.TableCellPadding;
}
}
}
}
}
When importing HTML content to a RadFlowDocument and exporting it to PDF format, the following error message occurs:
System.ArgumentException: 'The document element is associated with another parent. (Parameter 'item')'
at Telerik.Windows.Documents.Fixed.Model.Collections.DocumentElementCollection`2.VerifyDocumentElementOnInsert(T item)Table with specified width in inches is not correctly exported when the size is set in inches (this is done in the imported HTML)
Workaround: set the table size in the code and remove the style.
foreach (Table table in document2.EnumerateChildrenOfType<Table>())RTF import loses the font applied once at paragraph/body level and falls back to a default font instead, when the \fonttbl uses flat, non-grouped font entries rather than individually braced {\fN ...} fonts.
Workaround: Re-save the document in MS Word.