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
Related
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?
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?
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.
i am trying to print all the contents of a UserControl.
So what i need is to Print Preview the records of a DataGrid in WPF?
For printing is easy, we can use the PrintVisual and just send as argument our UserControl (in this case, the DataGrid).
It looks easy to Print, but i can't find anything to do the Print Preview.
Do we have anything in WPF to to this? And how?
Thanks in advance ;)
Related: How can I produce a "print preview" of a FlowDocument in a WPF application?
In WPF how to create a textblock with copy text option (OR) a text box with text trimming option. Any control template needed? If yes, please let us know hpw to build it.
Please help.
Sukan
First part is a duplicate of Any way to make a WPF textblock selectable?.
TextTrimming is a property in the TextBox.