HtmlFormatProvider: Exception when importing a table that has only width set. In this case, we are trying to measure some elements with float.NaN.
Workaround: Use the HtmlFormatProvider from the Document Processing library.
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("€");
}
};
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();