In this case, the MergeField Code value without the brackets gets concatenated before the display name of the MergeField in the document.
This reproduces after the document get exported and the DocxExportSettings' FieldResultMode property is set to FieldDisplayMode.DisplayName.
The MergeField is displayed correctly in RadRichTextBox. The issue occurs only when the document is displayed in MS Word.
To work this around, set the DocxExportSettings FieldResultMode value to null.
DocxFormatProvider docxFormatProvider = new DocxFormatProvider()
{
ExportSettings = new DocxExportSettings()
{
FieldResultMode = null
}
};
Austria (German) region is set in windows. Digit grouping symbol is set "," and decimal symbol is ".".
Inserting rounded rectangle shape in RichTextBox produces broken geometry like so:
PdfFormatProvider creates an invalid PDF document.
Workaround:
RadDocument radDocument = null;
XamlFormatProvider xamlformatProvider = new XamlFormatProvider();
using (FileStream inputStream = new FileStream("input.xaml", FileMode.Open))
{
Console.WriteLine("reading input file");
radDocument = xamlformatProvider.Import(inputStream);
}
var provider = new Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider();
var bytes = provider.Export(radDocument);
var provider2 = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
var flowDoc = provider2.Import(bytes);
var provider3 = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
using (Stream output = File.OpenWrite(@"output.pdf"))
{
Console.WriteLine("writing output file");
provider3.Export(flowDoc, output);
}
Console.WriteLine("done...");
Console.ReadKey();
this.radRichTextBox.PreviewEditorKeyDown += (sender, args) =>
{
if (Keyboard.Modifiers.HasFlag(ModifierKeys.Alt) && Keyboard.Modifiers.HasFlag(ModifierKeys.Control) && args.Key == Key.E)
{
args.SuppressDefaultAction = true;
args.OriginalArgs.Handled = true;
this.radRichTextBox.Insert("€");
}
};