The Spacing Before property of the paragraph at the start of the page should not be respected if it is not the first one inside the current section.
Manually overriding the Spacing Before property would resolve the issue.
Updating a Table of Contents field with a custom TOC Style does not respect it.
As a workaround modify the style after the TOC fields are updated.
When the last element in a table cell is an empty paragraph, the latter is skipped and not imported. It should be imported even if it's the only paragraph in the cell, as its properties could affect the layout and presentation (borders, colors, spacings).
When the document is encoded in two-byte encoding using Little-Endian, the CsQuery HTML parser provides the entire document as FirstChild of the <body> tag, which leads to incorrect import. This seems to be occurring with MS Outlook messages saved as HTML. Workaround: convert the file to Big-Endian encoding before importing.
Using a RadFlowDocumentEditor to add a page break and then insert a table, adds an additional paragraph in between.
As a workaround you can call the CleanParagraphsBeforeTablesOnNewPage() method:
private void CleanParagraphsBeforeTablesOnNewPage()
{
List<Paragraph> paragraphs = this.flowDocument.EnumerateChildrenOfType<Paragraph>().ToList();
foreach (var paragraph in paragraphs)
{
BlockContainerBase parent = (BlockContainerBase)paragraph.Parent;
int paragraphIndex = parent.Blocks.IndexOf(paragraph);
int blocksCount = parent.Blocks.Count;
bool isAfterPageBreak = paragraphIndex > 0 && this.PreviousBlockEndsWithPageBreak(parent.Blocks[paragraphIndex - 1]);
int nextIndex = paragraphIndex + 1;
bool nextBlockIsTable = nextIndex < blocksCount && parent.Blocks[nextIndex] is Table;
if (isAfterPageBreak && nextBlockIsTable)
{
parent.Blocks.Remove(paragraph);
}
}
}
private bool PreviousBlockEndsWithPageBreak(BlockBase blockBase)
{
bool isLastInlinePageBreak = false;
bool isParagraph = blockBase is Paragraph;
if (isParagraph)
{
Paragraph paragraph = (Paragraph)blockBase;
InlineBase lastInline = paragraph.Inlines.Last();
bool isBreak = lastInline is Break;
if (isBreak)
{
isLastInlinePageBreak = ((Break)lastInline).BreakType == BreakType.PageBreak;
}
}
return isLastInlinePageBreak;
}
The image in the header is not exported to pdf.
Workaround: Use version R1 2022 where this is working.
Currently some properties are supported only in their shorthand forms, and others - only in their longhand forms: - 'background' shorthand is not supported. - 'margin' shorthand is not supported.
- 'padding' shorthand is not supported. - 'border' shorthand is supported, but 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-left-color', 'border-left-style', 'border-left-width', 'border-right-color', 'border-right-style', 'border-right-width', 'border-style', 'border-top-color', 'border-top-style', 'border-top-width', 'border-width' are not supported.
IMPORTANT: This feature is available in .NET Core, .NET 6 and above.
When table row is empty, it's exported to PDF with incorrect height - depending on the type of height set with 0 or with the height of an empty paragraph.
TableRow which has defined an only val attribute of the trHeight is imported as a row with auto height. By the specification, this is right, but MS Word takes the val value as row height. Also MS Word exports "At Least" row height with only 'val' set.
Workaround: Iterate through the table rows and set them HeightType to Exact or AtLeast:
foreach (var row in this.document.EnumerateChildrenOfType<TableRow>())
{
row.Height = new TableRowHeight(HeightType.AtLeast, row.Height.Value);
}
First Footer of a section overrides the First Footer of another section after the merge. After merging 'Parent' document (with a different First Footer which is empty) with 'Child' document (with explicitly set First Footer), the First Footer of 'Child' overrides the First Footer of 'Parent' after PDF export.
Workaround 1: Disable 'Child' document's 'HasDifferentFirstPageHeaderFooter' and clear its First Footer's value:
Telerik.Windows.Documents.Flow.Model.Section section = child.Sections.First();
section.HasDifferentFirstPageHeaderFooter = false;
section.Footers.First.Blocks.Clear();
Workaround 2: Keep 'HasDifferentFirstPageHeaderFooter' of the 'Child' document as it is, and set the FIrst Footer of the 'Parent' document explicitly:parent.Sections.First().Footers.Add(HeaderFooterType.First);
Line spacing is not preserved when exporting RTF to HTML and the lines are exported with the default line spacing.