How generate PDF with RichTextBox data (Text + Image ) in C# Application - wpf

I have a richTextBox in wpf Application, which have Text + Image
I want to generate PDF with RichtextBox which display both Text and Images of RichTextBox

Here are some questions that are more or less the same question. Note the Document property of the RichTextBox is a FlowDocument.
WPF: flowdocument to PDF
What's the best way to convert a FlowDocument into PDF
How to save the content of flowDocument in PDF and Word?

Related

LineSpacing in WPF RichTextBox

I have written a text editor in WPF based on the WPF RichTextBox.
Everything works well. With BOLD, ITALIC etc., FontSize, FontFamily, TextAlignment and Indentation there are no problems.
But:
LineSpacing does not work! I can set the LineSpacing with Paragraph.LineHeight. When I save the text file in RTF format and load it again, the LineSpacing disappears. When loading, the corresponding RTF statement '\slnnn' is deleted.
If I load an RTF file from another text editor, the LineSpacing disappears also.
I know that I don't have the problem if I save the content of the RichTextBox as an XAML package and load it again. But then I am no longer compatible with other TextEditors.
Does anyone know a solution?

Binding HTML content to a "RichHTMLTextBlock" in XAML

I am having a WPF application, in which i am using RichTextBox and binding it to a field in the database which contains the data as a HTML text. Also i applied TextFormatter="{StaticResource HtmlFormatter}" for the RichTextBox. Now if in the field i have a paragraph with some html styles applies like font color, font size etc they are supposed to appear in the same style.But i am not able to see the font size in the application, though font style and font color are applied.
Can anybody help on this ?
Thanks in advance!!!

How to show a Word Document in a TabItem of TabControl in WPF?

Is there any way to open a Word Document in a TabItem of TabControl in WPF?
Add a DocumentViewer control to your TabItem which can host fixed documents like xps documents. You might need to convert your word document to xps document and then load it into the DocumentViewer control to display it.
More information can be found in this article.
It seems DocumentViewer cannot be converted to type System.Windows.Forms.Control when trying to add it to the TabItem's controls collection.

Display RTF with DocumentViewer

I need to display a RTF document in my WPF Application. I think DocumentViewer is the best choice because of search box and toolbar with print, zoom and so on. The problem is that I don't realize how to convert RTF format to FixedDocument. Any idea?
Thanks

WPF Richtext box content

how do i get the richtext box's content with all the formatting intact.
i used a TextRange object to get the content out of the richtext box but wen i get its .text property all its formatting is gone ... how do i get the formatted content in richtext box in wpf.
RichTextBox operates on FlowDocuments. You can get underlying FlowDocument from RichTextBox.Document property.

Resources