How to convert FlowDocument to rtf

前端 未结 3 1978
-上瘾入骨i
-上瘾入骨i 2020-12-15 10:46

I have used a WPF RichTextBox to save a flowdocument from it as byte[] in database. Now i need to retrieve this data and display in a report RichTextBox as an rtf. when i tr

3条回答
  •  我在风中等你
    2020-12-15 11:04

    This works like a charm for me. Displays the result in an RTF box without difficulties.

    public static string getDocumentAsXaml(IDocumentPaginatorSource flowDocument)
    {
         return XamlWriter.Save(flowDocument);
    }
    

提交回复
热议问题