Field code fragment is added to the result fragment and exported to PDF/HTML format. The problem is observed when the code fragment is divided into multiple inlines. For example we have PAGE field. If 'A' is bold we would have 3 inlines (runs) in the instruction text and the issue would be observed.
When a document containing a field without a separator is inserted using the RadFlowDocumentEditor.InsertDocument(*) method, NullRferenceException is thrown.
Workaround: Fix the document before inserting:
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);
}
}
}
}
Add support for smart tags (described in the OOXML using the smartTag element). As currently smart tags are not supported, the content inside them is not imported from docx.
Both properties table cell padding and table cell spacing are not exported to PDF format.
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;
}
Importing document with invalid bookmarks throws System.Collections.Generic.KeyNotFoundException. The issue is caused by an invalid bookmark having missing BookmarkRangeStart/bookmarkStart or BookmarkRangeEnd/bookmarkEnd elements.
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.
Implement nested mail merge and master-detail scenario.
The vertical alignment of the table cells is not exported to PDF. The values are always exported with top alignment.
Respect the Height property of TableRow when exporting with PdfFormatProvider.
The table is cut off when its width is larger than the default page width.
Workaround:
var htmlProvider = new HtmlFormatProvider();
var document = htmlProvider.Import(File.ReadAllText(@"..\..\HTMLPage1.html"));
var tables = document.EnumerateChildrenOfType<Table>();
double maxWidth = document.Sections.FirstOrDefault().PageSize.Width;
foreach (var item in tables)
{
if (item.PreferredWidth.Type == Telerik.Windows.Documents.Flow.Model.Styles.TableWidthUnitType.Fixed)
{
maxWidth = Math.Max(maxWidth, (item.PreferredWidth.Value + 100));
}
}
foreach (var item in document.Sections)
{
item.PageSize = new System.Windows.Size(maxWidth, item.PageSize.Height);
}
var pdfProvider = new PdfFormatProvider();
File.WriteAllBytes(@"..\..\result.pdf", pdfProvider.Export(document));
<w:tblCellMar>
<w:top w:w="2880" w:type="dxa"/>
<w:bottom w:w="2880" w:type="dxa"/>
</w:tblCellMar><w:tblCellMar>
<w:top w:w="2880" w:type="dxa"/>
<w:left w:w="0" w:type="dxa"/>
<w:right w:w="0" w:type="dxa"/>
<w:bottom w:w="2880" w:type="dxa"/>
</w:tblCellMar>