If a document has runs with font size larger than the one set in the style of the paragraphs and this document is exported to HTML, the resulting paragraphs overlap.
The hanging indent of the paragraph affects the rendering of content with tabs. However, the indent is not respected while generating the PDF, leading to disordered content.
Workaround: Insert a tab stop with the position set to the value for hanging indent:
foreach (var paragraph in this.flowDocument.EnumerateChildrenOfType<Paragraph>())
{
if (paragraph.Properties.HangingIndent.HasLocalValue)
{
Run run = paragraph.EnumerateChildrenOfType<Run>().Where(r => r.Text == "\t").FirstOrDefault();
if (run != null)
{
paragraph.TabStops = paragraph.TabStops.Insert(new Telerik.Windows.Documents.Flow.Model.Styles.TabStop(paragraph.Properties.HangingIndent.LocalValue.Value));
}
}
}
Exporting RTF document to HTML when there is a multilevel numbered list, strips the numbers and leaves only the main number visible (e.g. 2.1 becomes 1). Also, the text overlaps the numbering.
Workaround: Use numbers with letters instead of numbers only. (e.g. 1 a b c, 2 a b c).
To reproduce:
-Change the normal style in a document and insert it into another document using RenameSourceStyle option.
The style is renamed and inserted but is not applied to the content.
WordsProcessing: Merging a RadFlowDocument document into the target document over around 130 times breaks formatting when the target document is an empty RadFlowDocument.
The workaround to this issue is to set the target document to an existing RadFlowDocument such as the source before merging.
Exception when converting table with empty runs in the cells.
When calling the MailMerge method on a RadFlowDocument, which includes an IF field, where no FalseText (value to display when the expression evaluates to FALSE) is defined the following exception is thrown System.NullReferenceException: 'Object reference not set to an instance of an object.'
Workaround: Setting a string (empty works too) for the FalseText.
When the document is passed to the following method, all IF fields are edited so that the exception is not thrown:
private void EmptyIfSecondArgumentWorkaround(RadFlowDocument document)
{
List<FieldCharacter> collection = document.EnumerateChildrenOfType<FieldCharacter>().Where(f => f.FieldCharacterType == FieldCharacterType.Start).ToList();
for (int i = 0; i < collection.Count; i++)
{
FieldInfo item = collection[i].FieldInfo;
string code = item.GetCode();
FieldCharacter separator = item.Separator;
FieldCharacter end = item.End;
if (code.TrimStart().StartsWith("IF"))
{
FieldCharacter codeEnd;
if (separator.Paragraph != null)
{
codeEnd = separator;
}
else
{
codeEnd = end;
}
string emptyString = " \"\" ";
string mergeFormatCodeSuffix = "\\*";
if (codeEnd.Paragraph.Inlines.Count > 1)
{
string editedMergeFormatCodeSuffix = string.Join("", new string[] { emptyString, mergeFormatCodeSuffix });
int codeEndIndex = codeEnd.Paragraph.Inlines.IndexOf(codeEnd);
Run run = codeEnd.Paragraph.Inlines[codeEndIndex - 1] as Run;
if (run.Text.Contains(mergeFormatCodeSuffix))
{
run.Text=run.Text.Replace(mergeFormatCodeSuffix, editedMergeFormatCodeSuffix);
}
else
{
run.Text += emptyString;
}
}
}
}
}
When a field is formatted using the numberInDash format through the section's PageNumberingSettings, the format is not parsed and the field result is not included in the PDF document.
Workaround: Remove the formatting from the section settings:
foreach (var section in this.document.Sections)
{
section.PageNumberingSettings.PageNumberFormat = null;
}